[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide



The initialize Method

The way you write the geometry management sections of an initialize method depends heavily on whether you are writing a primitive widget or a manager widget.

Primitive Widgets

If the value of core.width or core.height is 0, then the initialize method of your primitive widget should generate a starting widget size. If the user or application has set a starting value for XmNwidth or XmNheight other than 0, then the initialize method should honor the user's or application's preference for its starting size.

A parent will treat the child's starting size as a suggestion. In other words, the parent may choose to honor or to ignore the child's starting size, or possibly to compromise on the starting size.

For consistency with other Motif widgets, your widget should set the core.width field to 0 when you want the widget to calculate a new preferred width and the core.height field to 0 when you want the widget to calculate a new preferred height.

Manager Widgets

Theinitialize methods of most manager widgets seldom perform any geometry management. In general, the initialize method should not specify values for any of the Core geometry resources shown in Table 12-1. Typically, the change_managed method of your manager's parent will establish the starting position and dimensions of your manager.


[ Previous | Next | Contents | Glossary | Home | Search ]