DwtMainWindow(3Dwt)
Name
DwtMainWindow, DwtMainWindowCreate − Creates the main window widget.
Syntax
Widget DwtMainWindow(parent_widget, name, x, y, width, height)
Widget parent_widget;
char *name;
Position x, y;
Dimension width, height;
Widget DwtMainWindowCreate (parent_widget, name,
override_arglist, override_argcount)
Widget parent_widget;
char *name;
ArgList override_arglist;
int override_argcount;
Arguments
parent_widget
Specifies the parent widget ID. For some applications, the parent widget ID for the main window widget is the ID returned by XtInitialize. However, the main window widget is not restricted to this type of parent.
nameSpecifies the name of the created widget.
xSpecifies the placement, in pixels, of the left side of the widget window relative to the inner upper left corner of the parent window. This argument sets the DwtNx core widget attribute.
ySpecifies, in pixels, the placement of the upper left corner of the widget window relative to the inner upper left corner of the parent window. This argument sets the DwtNy core widget attribute.
widthSpecifies in pixels the width of the widget window. This argument sets the DwtNwidth core widget attribute.
heightSpecifies in pixels the height of the widget window. This argument sets the DwtNheight core widget attribute.
override_arglist
Specifies the application override argument list.
override_argcount
Specifies the number of attributes in the application override argument list (override_arglist).
Description
The DwtMainWindow and DwtMainWindowCreate functions create an instance of the main window widget and return its associated widget ID. When calling DwtMainWindow, you set the main window widget attributes presented in the formal parameter list. For DwtMainWindowCreate, however, you specify a list of attribute name/value pairs that represent all the possible attributes of the main window widget.
The main window widget can contain a menu bar region, a work area with optional scroll bars, and a command area.
Inherited Attributes
| Attribute Name | Data Type | Default |
| Core Attributes | ||
| DwtNx | Position | Determined by the geometry manager |
| DwtNy | Position | Determined by the geometry manager |
| DwtNwidth | Dimension | 5 pixels |
| DwtNheight | Dimension | 5 pixels |
| DwtNborderWidth | Dimension | One pixel |
| DwtNborder | Pixel | Default foreground color |
| DwtNborderPixmap | Pixmap | NULL |
| DwtNbackground | Pixel | Default background color |
| DwtNbackgroundPixmap | Pixmap | NULL |
| DwtNcolormap | Colormap | Default color map |
| DwtNsensitive | Boolean | True |
| DwtNancestorSensitive | Boolean | The bitwise AND of the parent widget’s DwtNsensitive and DwtNancestorSensitive attributes |
| DwtNaccelerators | XtTranslations | NULL |
| DwtNdepth | int | Depth of the parent window |
| DwtNtranslations | XtTranslations | NULL |
| DwtNmappedWhenManaged | Boolean | True |
| DwtNscreen | Screen * | The parent screen |
| DwtNdestroyCallback | DwtCallbackPtr | NULL |
| Common Attributes | ||
| DwtNforeground | Pixel | Default foreground color |
| DwtNhighlight | NOT SUPPORTED | |
| DwtNhighlightPixmap | NOT SUPPORTED | |
| DwtNuserData | Opaque * | NULL |
| DwtNdirectionRToL | unsigned char | DwtDirectionRightDown |
| DwtNfont | NOT SUPPORTED | |
| DwtNhelpCallback | DwtCallbackPtr | NULL |
Widget-Specific Attributes
| Attribute Name | Data Type | Default |
| DwtNcommandWindow | Widget | NULL |
| DwtNworkWindow | Widget | NULL |
| DwtNmenuBar | Widget | NULL |
| DwtNhorizontalScrollBar | Widget | NULL |
| DwtNverticalScrollBar | Widget | NULL |
| DwtNacceptFocus | Boolean | False |
| DwtNfocusCallback | DwtCallbackPtr | NULL |
DwtNcommandWindow
Specifies the widget ID for the command window to be associated with the main window widget. You can set this ID only after creating an instance of the main window widget.
DwtNworkWindowSpecifies the widget ID for the work window to be associated with the main window widget. You can set this ID only after creating an instance of the main window widget.
DwtNmenuBarSpecifies the widget ID for the menu bar to be associated with the main window widget. You can set this ID only after creating an instance of the main window widget.
DwtNhorizontalScrollBar
Specifies the scroll bar widget ID for the horizontal scroll bar in the main window widget. You can set this ID only after creating an instance of the main window widget.
DwtNverticalScrollBar
Specifies the scroll bar widget ID for the vertical scroll bar in the main window widget. You can set this ID only after creating an instance of the main window widget.
DwtNacceptFocus
Specifies a boolean value that, when False, indicates that the main window widget does not accept the input focus. When the main window widget is asked to accept the input focus, it attempts to give the input focus first to DwtNworkWindow and then to DwtNcommandWindow. If neither accepts the input focus and DwtNacceptFocus is True, the main window widget accepts the input focus.
DwtNfocusCallback
Specifies the callback function or functions called when the main window has accepted the input focus. For this callback, the reason is DwtCRFocus.
Return Value
These functions return the ID of the created widget.
Callback Information
The following structure is returned to your callback:
typedef struct {
int reason;
XEvent *event;
} DwtAnyCallbackStruct;
The reason member is set to a constant that represents the reason why this callback was invoked. For this callback, the reason member can be set to:
| DwtCRFocus | The main window widget has received the input focus. |
| DwtCRHelpRequested | The user selected help. |
The event member is a pointer to the Xlib structure XEvent, which describes the event that generated this callback. This structure is a union of the individual structures declared for each event type. For information on XEvent and event processing, see the Guide to the Xlib Library: C Language Binding.
See Also
Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding