# Sme Object

    Application Header file	<X11/Xaw/Sme.h>

    Class Header file	<X11/Xaw/SmeP.h>

    Class		smeObjectClass

    Class Name	Sme

    Superclass	RectObj

The Sme object is the base class for all menu entries. While this object is mainly intended to be subclassed, it may be used in a menu to add blank space between menu entries.

## Resources

The resources associated with the SmeLine object are defined in this section, and affect only the single menu entry specified by this object. There are no new resources added for this class, as it picks up all its resources from the RectObj class.

Name | Class | Type | Notes | Default Value
ancestorSensitive | AncestorSensitive | Boolean |  | True
callback | Callback | XtCallbackList |  | NULL
destroyCallback | Callback | XtCallbackList |  | NULL
height | Height | Dimension |  | 0
international | International | Boolean | C | False
sensitive | Sensitive | Boolean |  | True
width | Width | Dimension |  | 1

Keep in mind that the SimpleMenu widget will force all menu items to be the width of the widest entry.

## Subclassing the Sme Object

To Create a new Sme object class you will need to define three class methods. These methods allow the SimpleMenu to highlight and unhighlight the menu entry as the pointer cursor moves over it, as well as notify the entry when the user has selected it. All of these methods may be inherited from the Sme object, although the default semantics are not very interesting.

`Highlight`( )

- Called to put the menu entry into the highlighted state.

`Unhighlight`( )

- Called to return the widget to its normal (unhighlighted) state.

`Notify`( )

- Called when the user selects this menu entry.

Other then these methods, creating a new object is straight forward. Here is some information that may help you avoid some common mistakes.

1. Objects can be zero pixels high.

2. Objects draw on their parent's window, therefore the Drawing dimensions are different from those of widgets. For instance, y locations vary from `y` to `y + height`, not `0` to `height`.

3. XtSetValues calls may come from the application while the Sme is highlighted, and if the SetValues method returns True, will result in an expose event. The SimpleMenu may later call the menu entry's `unhighlight` procedure. However, due to the asynchronous nature of X, the expose event generated by XtSetValues will come after this unhighlight.

4. Remember that your subclass of the Sme does not own the window. Share the space with other menu entries, and refrain from drawing outside the subclass's own section of the menu.