18 |
|
|
19 |
int |
int |
20 |
XMenuAddPane(display, menu, label, active) |
XMenuAddPane(display, menu, label, active) |
21 |
Display *display; |
Display *display; |
22 |
register XMenu *menu; /* Menu object to be modified. */ |
register XMenu *menu; /* Menu object to be modified. */ |
23 |
register char *label; /* Selection label. */ |
register char *label; /* Selection label. */ |
24 |
int active; /* Make selection active? */ |
int active; /* Make selection active? */ |
25 |
{ |
{ |
26 |
register XMPane *pane; /* Newly created pane. */ |
register XMPane *pane; /* Newly created pane. */ |
27 |
register XMSelect *select; /* Initial selection for the new pane. */ |
register XMSelect *select; /* Initial selection for the new pane. */ |
28 |
|
|
29 |
int label_length; /* Label length in characters. */ |
int label_length; /* Label length in characters. */ |
30 |
int label_width; /* Label width in pixels. */ |
int label_width; /* Label width in pixels. */ |
31 |
|
|
50 |
_XMErrorCode = XME_CALLOC; |
_XMErrorCode = XME_CALLOC; |
51 |
return(XM_FAILURE); |
return(XM_FAILURE); |
52 |
} |
} |
53 |
|
|
54 |
/* |
/* |
55 |
* Determine label size. |
* Determine label size. |
56 |
*/ |
*/ |
58 |
label_width = XTextWidth(menu->p_fnt_info, |
label_width = XTextWidth(menu->p_fnt_info, |
59 |
label, |
label, |
60 |
label_length); |
label_length); |
61 |
|
|
62 |
/* |
/* |
63 |
* Set up the initial selection. |
* Set up the initial selection. |
64 |
* Values not explicitly set are zeroed by calloc. |
* Values not explicitly set are zeroed by calloc. |
87 |
emacs_insque(pane, menu->p_list->prev); |
emacs_insque(pane, menu->p_list->prev); |
88 |
|
|
89 |
/* |
/* |
90 |
* Update the pane count. |
* Update the pane count. |
91 |
*/ |
*/ |
92 |
menu->p_count++; |
menu->p_count++; |
93 |
|
|