# Primitive Widgets

Motif provides several classes of widgets. One such class is the Primitive class, which as the name suggests, are the basic low level components out of which you can build an interface.

Primitive widgets do not support child widgets of their own.

The Label widget simply provides a visual label onto which you can place text or an image.

Cascade, Drawn, Push, and Toggle Buttons are derived from the Label widget, but are also considered to be Primitive. They also have a visual label, but also provide some basic user interaction facilities through the use of callbacks. Each button has different appearance and differing types of callbacks which can be called, but the principal is the same: the mouse is moved or pressed over the widget, and an interface event occurs. The Cascade button is special in that it is used in menus.

The Arrow Button widget is not derived from Label, although it also has a visual surface, and also has simple mouse event callbacks which can be registered for the widget. The button simply contains an arrow pointing in one of the four cardinal directions.

The List widget provides the means whereby a group of textual items can be presented to the user for selection. You can specify how many items from the list can be simultaneously selected.

The Scroll Bar widget is nearly always used in conjunction with a scrolled window, and is used as a means of providing a viewport onto a widget which potentially cannot all be displayed on the screen. The scrollbar adjusts the viewport in response to user mouse events in the widget.

The Separator widget is for visual aid only, to separate items on the display. It does not have any interface actions associated with it.

The Text (and TextField) widget is intended to form the basis of a complete text editing widget. The TextField widget is a light weight version of the Text widget proper, and is a single line data entry widget. There is a large range of callbacks associated with the text widget, and these can be used for input verification and mouse tracking, out of which a graphical text editor can be built.

For a more detailed discussion of Primitive widgets, please consult your OSF/Motif Programmer's Reference Manual.

NOTES

Although in WorkShop Visual it may appear that a Cascade button can have a menu as a child, this is in fact not the case in reality: the menu is placed under the cascade button for clarity so you know which menu is associated with any given cascade button, but when it comes to generating code, WorkShop Visual correctly parents the menu off the parent of the cascade button, and not from the cascade button itself.

See also:

- Manager Widgets
- Label widget
- Cascade Button widget
- Drawn Button widget
- Push Button widget
- Toggle Button widget
- Arrow Button widget
- List widget
- Scroll Bar widget
- Separator widget
- Text widget
- Callbacks panel
- About WorkShop Visual