1 /* Copyright Massachusetts Institute of Technology 1985 */
7 * XMenu: MIT Project Athena, X Window system menu package
9 * XMenuChangePane - Change the label of a menu pane.
11 * Author: Tony Della Fera, DEC
20 XMenuChangePane(register XMenu
*menu
, register int p_num
, char *label
)
21 /* Menu object to be modified. */
22 /* Pane number to be modified. */
23 /* Selection label. */
25 register XMPane
*p_ptr
; /* XMPane pointer. */
27 int label_length
; /* Label length in characters. */
28 int label_width
; /* Label width in pixels. */
31 * Check for NULL pointers!
34 _XMErrorCode
= XME_ARG_BOUNDS
;
39 * Find the right pane.
41 p_ptr
= _XMGetPanePtr(menu
, p_num
);
42 if (p_ptr
== NULL
) return(XM_FAILURE
);
45 * Determine label size.
47 label_length
= strlen(label
);
48 label_width
= XTextWidth(menu
->p_fnt_info
, label
, label_length
);
51 * Change the pane data.
54 p_ptr
->label_width
= label_width
;
55 p_ptr
->label_length
= label_length
;
58 * Schedule a recompute.
63 * Return the pane number just changed.
65 _XMErrorCode
= XME_NO_ERROR
;