3 /* Copyright Massachusetts Institute of Technology 1985 */
4 /* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. */
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
19 XMenuChangePane(menu
, p_num
, label
)
20 register XMenu
*menu
; /* Menu object to be modified. */
21 register int p_num
; /* Pane number to be modified. */
22 char *label
; /* Selection label. */
24 register XMPane
*p_ptr
; /* XMPane pointer. */
26 int label_length
; /* Label length in characters. */
27 int label_width
; /* Label width in pixels. */
30 * Check for NULL pointers!
33 _XMErrorCode
= XME_ARG_BOUNDS
;
38 * Find the right pane.
40 p_ptr
= _XMGetPanePtr(menu
, p_num
);
41 if (p_ptr
== NULL
) return(XM_FAILURE
);
44 * Determine label size.
46 label_length
= strlen(label
);
47 label_width
= XTextWidth(menu
->p_fnt_info
, label
, label_length
);
50 * Change the pane data.
53 p_ptr
->label_width
= label_width
;
54 p_ptr
->label_length
= label_length
;
57 * Schedule a recompute.
62 * Return the pane number just changed.
64 _XMErrorCode
= XME_NO_ERROR
;
68 /* arch-tag: e267e9de-a3f0-4a0d-8c45-413afa176fd8
69 (do not change this comment) */