## WorkShop Visual Replay Command Syntax - Button Actions (Position Dependent Controls)

#### Keywords

- push - press and release a mouse button
- drag - combine a press and release within the same widget

#### Synopsis

        push widget(mame,qual)
        drag widget(name1,qual1)-widget(name2,qual2)

#### Inputs

- widget - a widget name
- name , name1, name2 - application/widget dependent description
- qual, qual1, qual2 - a qualification of the description

#### Description

In some widgets (e.g. drawing areas) where you click is important. In the case of drawing areas, a position within the drawing area is needed. For lists, you need an indication of which item has been selected. The version of push listed above is intended for such position-dependent widget.

In these widgets, you will often need to do more than just click. You may need to press down at one point and release at another. An example is the setting up of attachments between widgets in the visu form layout editor. This may involve a server grab, so it is described as a single drag operation where the first part describes where you pressed and the second where you released the button.

This mechanism can be used for single user-defined widget instances, such as the drawing areas within your application and also for entire widget classes (as we have done for XmList, XmScale and XmScrollBar and various 3rd party widget sets.)

#### Examples

The first example shows how the Motif DrawingArea widget has been implemented for visu testing:

        in ApplicationShell
    	push tree_da(mybutton,centre)

In the next example we show how attachments are made between the frame1 and button_box widgets in the visu form layout editor:

        in form_layout
    	drag layout(frame1,right)-layout(button_box,left)

You can try out these effects in visu.

#### Notes

See Extending the WorkShop Visual Replay Widget Set for information on how to handle your own position-dependent widgets, or those from a 3rd party supplier.

See also:

- WorkShop Visual Replay Command Syntax