The Drawing Area widget provides a surface onto which text and graphics can be written. Applications can use Xlib and Xt Intrinsics functions to write into the Drawing Area in order to build a sophisticated graphics application.
The X-Designer Design Area and the Layout Editor are both examples of Drawing Area widgets.
A Drawing Area can contain an arbitrary number of child widgets, which can be positioned using the X-Designer Layout Editor.
In Microsoft Windows mode, the Drawing Area resource panel is very different because of the different way in which events are handled on Microsoft Windows. You are presented with a list of Microsoft Windows message handlers. X-Designer generates a callback for each one of these selected. The callback buttons are pink indicating that they are only relevant on Motif.
For more information on the Drawing Area widget, consult XmDrawingArea(3X) in the OSF/Motif Programmer's Reference.
HINTS
One or more pop-up menus can be defined for a Drawing Area by adding Menu widgets to the Drawing Area. If you press mouse button 3 within your drawing area widget, the pop-up menu will be displayed at the cursor position.
If you have more than one pop-up menu, X-Designer will assume that you want to display the menu which is currently selected (or which contains the currently selected widget). If no menu contains, or is, the selected widget, X-Designer will use the first (leftmost) pop-up menu child of the widget.
The code to display and arbitrate between your various pop-up menus is internal to X-Designer. You must provide some code within your application for the same effect to take place at run-time.
In Motif 1.2 or earlier, this consists of adding an event handler to catch button press events, then calling XmMenuPosition(3X), followed by XtManageChild(3X) on the chosen menu in order to position and display the menu at the cursor location.
In Motif 2.1, this can be achieved by adding an XmPopupHandlerCallback to the Drawing Area, and setting the widget ID of the required menu to the menuToPost element of the XmPopupHandlerCallbackStruct passed to the callback. The XmNpopupEnabled resource of the popup menu can also be set to XmPOPUP_AUTOMATIC or XmPOPUP_AUTOMATIC_RECURSIVE, so that the Motif toolkit itself installs event handlers to capture the mouse press event. If you only have one popup menu in the drawing area, simply setting XmNpopupEnabled appropriately should suffice.
See also: