(Fforward_comment): Use type int for `from' and `from_byte'.
[emacs.git] / oldXMenu / ChgPane.c
blob20b0a949d9a3699953bbf4548cc2fb04e754a190
1 #include "copyright.h"
3 /* Copyright Massachusetts Institute of Technology 1985 */
4 /* Copyright (C) 2002, 2003, 2004, 2005,
5 2006 Free Software Foundation, Inc. */
7 /*
8 * XMenu: MIT Project Athena, X Window system menu package
10 * XMenuChangePane - Change the label of a menu pane.
12 * Author: Tony Della Fera, DEC
13 * December 19, 1985
17 #include "XMenuInt.h"
19 int
20 XMenuChangePane(menu, p_num, label)
21 register XMenu *menu; /* Menu object to be modified. */
22 register int p_num; /* Pane number to be modified. */
23 char *label; /* 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!
33 if (label == NULL) {
34 _XMErrorCode = XME_ARG_BOUNDS;
35 return(XM_FAILURE);
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.
53 p_ptr->label = label;
54 p_ptr->label_width = label_width;
55 p_ptr->label_length = label_length;
58 * Schedule a recompute.
60 menu->recompute = 1;
63 * Return the pane number just changed.
65 _XMErrorCode = XME_NO_ERROR;
66 return(p_num);
69 /* arch-tag: e267e9de-a3f0-4a0d-8c45-413afa176fd8
70 (do not change this comment) */