Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ OlDragAndDrop(3W) — OpenWindows V2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

OlDetermineMouseAction(3)

OlGrabDragPointer(3)

OlUngrabDragPointer(3)

OlDragAndDrop(3W)  —  MISC. REFERENCE MANUAL PAGES

Dynamic Settings

NAME

 OlDragAndDrop

SYNOPSIS

#include <OpenLook.h>
#include <Dynamic.h>
 ...
extern void OlDragAndDrop(w, window, xPosition, yPosition)
Widget     w;
Window ∗   window;
Position ∗ xPosition;
Position ∗ yPosition;

DESCRIPTION

The OlDragAndDrop function is used to monitor a direct manipulation operation; returning, when the operation is completed, the drop_window and the x and y coordinates corresponding to the location of the drop.  These return values will reflect the highest (in the stacking order) window located under the pointer at the time of the button release. 

SEE ALSO

OlDetermineMouseAction(3), OlGrabDragPointer(3), OlUngrabDragPointer(3)

EXAMPLE

The following code provides a sample of the use of the facilities:
LookupOlInputEvent, OlDetermineMouseAction, OlGrabDragPointer,
OlDragAndDrop, OlUngrabDragPointer, and OlReplayBtnEvent

static void Button();
static char translations[]   = "<BtnDown> button()0;
static XtActionRec actions[] = { "button()", Button };
static void Button(widget, event, params, num_params)
Widget     widget;
XEvent ∗   event;
String ∗   params;
Cardinal ∗ num_params;
{
Window   drop_window;
Position x;
Position y;
switch (LookupOLInputEvent(widget, event, NULL, NULL))
  {
 case OL_SELECT:~
    switch(OlDetermineMouseAction(widget, event))
      {
       case MOUSE_MOVE:~
         OlGrabDragPointer(widget, OlGetMoveCursor(XtScreen(widget), None);
         OlDragAndDrop(widget, &drop_window, &x, &y);
         DropOn(widget, drop_window, x, y, ....);
         OlUngrabDragPointer(widget);
         break;
      case MOUSE_CLICK:~
         ClickSelect(widget, ....);
         break;
      case MOUSE_MULTI_CLICK:~
         MultiClickSelect(widget,  ....);
         break;
      default:~
         Panic(widget, ....);
         break;
      }
     break;
   default:~
     OlReplayBtnEvent(widget, NULL, event);
     break;
  }
}

Sun Release 4.0  —  Last change:   —  Last change:

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026