push widget(mame,qual) drag widget(name1,qual1)-widget(name2,qual2)
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 XDesigner 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.)
The first example shows how the Motif DrawingArea widget has been implemented for XDesigner 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 XDesigner form layout editor:
in form_layout drag layout(frame1,right)-layout(button_box,left)
You can try out these effects in XDesigner.
See Extending the X-Designer Replay Widget Set for information on how to handle your own position-dependent widgets, or those from a 3rd party supplier.
See also: