LINFO

Drag-and-drop Definition



Drag-and-drop is the ability to move graphical user interface (GUI) objects, i.e., icons and windows (and menus on some programs), by means of manipulating a mouse or other tracking device (such as a trackball, touchpad or pointing stick).

A GUI is a human-computer interface (i.e., a way for humans to interact with computers) that uses windows, icons and menus, which can be manipulated by a mouse or other pointing device (and often to a limited extent by a keyboard as well). GUIs stand in sharp contrast to command line interfaces (CLIs), such as MS-DOS or Linux in console mode, which use only text and are accessed solely by a keyboard.

Drag-and-drop is a major feature of modern GUIs, along with other mouse operations such as point-and-click and cut-and-paste. It is a very intuitive operation and has helped make computers easier to use for large numbers of people.

The basic sequence involved in a drag-and-drop operation is to (1) press, and hold down, the button (usually the left button) on the mouse or other pointing device in order to grab the object, (2) drag the object with the pointing device to the desired location on the display screen and (3) drop the object by releasing the mouse button.

The locations to which an object can be dragged and the results of dropping the object depend on several factors, including the operating system and its settings and the application program(s) involved. For example, many systems have settings that allow the user to choose whether icons can be dragged (1) to any position within a window or on the display screen or (2) to only fixed positions on an invisible grid on the screen or in the window.

Likewise depending on the situation, icons can be dragged so that they rest on top of other icons, so that they disappear into other icons or so that they cause some event to occur, such as launching a program. In advanced GUIs drag-and-drop can work not only on the desktop and within programs but also between programs (such as dragging an image from a browser or an image processing program into a word processing program).

Drag-and-drop can be used to create various types of associations among objects and to invoke various types of actions. Examples include rearranging icons in a directory to customize its layout, dragging a file to a different directory in order to change its location or copy it, moving a data file icon onto a program icon or program window for viewing or processing, dragging a command onto an object in order to apply the command (e.g., dragging a color sample or a pattern sample onto an object in an art program to change its color), creating a hyperlink from one word or location to another location or document, and dragging an icon representing a file to a trash can icon in order to delete that file.

A very useful feature of Unix-like operating systems is their ability to allow drag-and-drop to be used not only on a single operating system but also between other operating systems that are installed on the same computer or network. That is, objects from one operating system can be easily moved among partitions on a single hard disk drive (HDD), among different HDDs and among different machines on a network regardless of the operating system on each. For example, a file or directory in Linux can be dragged to Microsoft Windows and visa versa. This is not possible if the computer has been booted into (i.e., started in ) Microsoft Windows, but it is possible with the Mac OS X because its underlying operating system is a Unix-like system.

All operations that can be performed by drag-and-drop in a GUI can also be performed at the command line (i.e., all-text mode) in Unix-like operating systems, as the GUI is merely a front end for the command line. In some situations the command line alternative is preferable, particularly in the case of advanced users and when drag-and-drop is not practical or fails.

The concept of dragging icons may have been developed at Xerox Palo Alto Research Center (PARC), but it was subsequently refined by Apple Computer and the first commercial use of drag-and-drop was on the first Macintosh model when it was launched in 1984.






Created July 26, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.