summaryrefslogtreecommitdiff
path: root/xc/doc/specs/Xaw/Sme
blob: 5c63b02e059050fed1436b549479220d3b33d377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.\" $XConsortium$
.NH 2
Sme Object
.LP
.XS
	Sme Object
.XE
.IN "Sme object" "" "@DEF@"
.sp
.Ds 0
.TA 2.0i
.ta 2.0i
Application Header file	<X11/Xaw/Sme.h>
.IN "Sme.h" ""
Class Header file	<X11/Xaw/SmeP.h>
.IN "SmeP.h" ""
Class		smeObjectClass
.IN "smeObjectClass" ""
Class Name	Sme
.IN "Sme object" "class name"
Superclass	RectObj
.De
.sp
.LP
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.  
.NH 3
Resources
.IN "SmeLine object" "resources"
.LP
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.
.TS H
lw(1.5i) lw(1i) lw(1i) lw(.5i) lw(2i).
_
.sp 3p
.TB
Name	Class	Type	Notes	Default Value
.sp 3p
_
.TH
.R
.sp 3p
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
.sp 3p
_
.TE
.As
.Dc
.Hw
Keep in mind that the SimpleMenu widget will force all menu items to
be the width of the widest entry.
.Ix Bold
.Se
.NH 3
Subclassing the Sme Object
.IN "Sme object" "subclassing" "@DEF"
.LP
.sp
To Create a new Sme object \fIclass\fP 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.
.IP \fBHighlight\fP(\|) 1i
.IN "Sme object" "Highlight method"
Called to put the menu entry into the highlighted state.
.IP \fBUnhighlight\fP(\|) 1i
.IN "Sme object" "Unhighlight method"
Called to return the widget to its normal (unhighlighted) state.
.IP \fBNotify\fP(\|) 
.IN "Sme object" "Notify method"
Called when the user selects this menu entry.
.LP
.sp
Other then these methods, creating a new object
is straight forward.  Here is some information that may help you
avoid some common mistakes.
.IP 1) 3n
Objects can be zero pixels high.
.IP 2) 3n
Objects draw on their parent's window, therefore the Drawing dimensions
are different from those of widgets.  For instance, y locations vary
from \fBy\fP to \fBy + height\fP, not \fB0\fP to \fBheight\fP.
.IP 3) 3n
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 \fBunhighlight\fP
procedure.  However, due to the asynchronous nature of
X, the expose event generated by \fBXtSetValues\fP will come \fIafter\fP
this unhighlight.
.IP 4) 3n
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.