* sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
[emacs.git] / oldXMenu / ChgPane.c
blobd2977b73faf191a696b6a290e4eeb1d6e4e9529c
1 /* Copyright Massachusetts Institute of Technology 1985 */
3 #include "copyright.h"
6 /*
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
12 * December 19, 1985
16 #include "XMenuInt.h"
18 int
19 XMenuChangePane(register XMenu *menu, register int p_num, char *label)
20 /* Menu object to be modified. */
21 /* Pane number to be modified. */
22 /* 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!
32 if (label == NULL) {
33 _XMErrorCode = XME_ARG_BOUNDS;
34 return(XM_FAILURE);
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.
52 p_ptr->label = label;
53 p_ptr->label_width = label_width;
54 p_ptr->label_length = label_length;
57 * Schedule a recompute.
59 menu->recompute = 1;
62 * Return the pane number just changed.
64 _XMErrorCode = XME_NO_ERROR;
65 return(p_num);