![]() |
![]() |
| ||||||||||||||||||||
Chapter 7Common Desktop Environment Motif WidgetsThe Common Desktop Environment provides Motif 2.1 libraries (with bug fixes) and enhancements. In addition, the Common Desktop Environment provides four custom widgets you can use to provide certain OPEN LOOK and Microsoft® Windows functionality. This chapter describes these Motif custom widgets. The widget library, libDtWidget, contains four widgets that combine or enhance functionality of existing Motif 2.1 widgets:
These widgets provide common functionality across all Common Desktop Environment applications. None of these widgets support subclassing. The Custom Widgets library depends directly on the following libraries:
Menu Button Widget (DtMenuButton)Use the DtMenuButton widget to provide menu-cascading functionality outside of a menu pane. DtMenuButton widget is a command widget that complements the menu cascading functionality of an XmCascadeButton widget. As a complement to XmCascadeButton widget, it can only be instantiated outside a MenuBar, Pulldown, or Popup (use XmCascadeButton widget inside a MenuPane.)Figure 7-1 shows examples of a DtMenuButton widget. Figure 7-1 Examples of menu button widget (DtMenuButton) ![]() Library and Header FilesThe DtMenuButton widget is in the libDtWidget library. The header file is Dt/MenuButton.h. Demo ProgramA demo containing an example of the DtMenuButton widget is in /usr/dt/examples/dtwidget/controls.c. Convenience FunctionsDtCreateMenuButton() is a convenience function that creates a Common Desktop Environment widget. DtMenuButton widget is a subclass of XmLabel class. Visually, DtMenuButton widget has a label string and a menu glyph. The menu glyph always appears on the right end of the widget and, by default, is a downward pointing arrow. DtMenuButton widget has an implicitly created submenu attached to it. The submenu is a pop-up menu and has this DtMenuButton widget as its parent. The name of the implicitly created submenu is obtained by prefixing submenu_ to the name of this DtMenuButton widget. You can obtain the widget ID of the submenu by setting an XtGetValues on DtNsubMenuId resource of this DtMenuButton widget. The implicitly created submenu must not be destroyed by the user of this widget. The submenu can be popped up by pressing the menu post button (see XmNmenuPost resource of XmRowColumn) anywhere on the DtMenuButton widget or by pressing the Motif Cancel key (usually Escape). ClassesDtMenuButtonWidget inherits behavior and resources from Core, XmPrimitive, and XmLabel classes. The class pointer is dtMenuButtonWidgetClass. The class name is DtMenuButtonWidget. DtMenuButtonWidget does not support subclassing. ResourcesDtMenuButtonWidget provides the following resources. Table 7-1 shows the class, type, default, and access for these resources.
See the DtMenuButtonWidget(3X) man page for more information. The codes in the access column show if you can:
Table 7-1 DtMenuButtonWidget Resources
| ||||||||||||||||||||
| ||||||||||||||||||||