Mercurial > emacs
annotate lwlib/lwlib-Xm.c @ 15606:1891a5cddce6
Removed debug code.
author | Simon Marshall <simon@gnu.org> |
---|---|
date | Fri, 05 Jul 1996 13:35:41 +0000 |
parents | 9aa89ea71d5b |
children | de5c3eda52fc |
rev | line source |
---|---|
5626 | 1 /* The lwlib interface to Motif widgets. |
2 Copyright (C) 1992 Lucid, Inc. | |
3 | |
4 This file is part of the Lucid Widget Library. | |
5 | |
6 The Lucid Widget Library is free software; you can redistribute it and/or | |
7 modify it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation; either version 1, or (at your option) | |
9 any later version. | |
10 | |
11 The Lucid Widget Library is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GNU Emacs; see the file COPYING. If not, write to | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14018
diff
changeset
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14018
diff
changeset
|
19 Boston, MA 02111-1307, USA. */ |
5626 | 20 |
21 #include <stdlib.h> | |
22 #include <unistd.h> | |
23 #include <string.h> | |
24 #include <stdio.h> | |
25 | |
26 #include <X11/StringDefs.h> | |
27 #include <X11/IntrinsicP.h> | |
28 #include <X11/ObjectP.h> | |
29 #include <X11/CoreP.h> | |
30 #include <X11/CompositeP.h> | |
31 | |
32 #include "lwlib-Xm.h" | |
33 #include "lwlib-utils.h" | |
34 | |
35 #include <Xm/BulletinB.h> | |
36 #include <Xm/CascadeB.h> | |
14931
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
37 #include <Xm/CascadeBG.h> |
5626 | 38 #include <Xm/DrawingA.h> |
39 #include <Xm/FileSB.h> | |
40 #include <Xm/Label.h> | |
41 #include <Xm/List.h> | |
8784 | 42 #include <Xm/MainW.h> |
5626 | 43 #include <Xm/MenuShell.h> |
44 #include <Xm/MessageB.h> | |
8784 | 45 #include <Xm/PanedW.h> |
5626 | 46 #include <Xm/PushB.h> |
47 #include <Xm/PushBG.h> | |
48 #include <Xm/ArrowB.h> | |
49 #include <Xm/SelectioB.h> | |
50 #include <Xm/Text.h> | |
51 #include <Xm/TextF.h> | |
52 #include <Xm/ToggleB.h> | |
53 #include <Xm/ToggleBG.h> | |
54 #include <Xm/RowColumn.h> | |
55 #include <Xm/ScrolledW.h> | |
56 #include <Xm/Separator.h> | |
57 #include <Xm/DialogS.h> | |
58 #include <Xm/Form.h> | |
59 | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
60 static void xm_pull_down_callback (/* Widget, XtPointer, XtPointer */); |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
61 static void xm_internal_update_other_instances (/* Widget, XtPointer, |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
62 XtPointer */); |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
63 static void xm_generic_callback (/* Widget, XtPointer, XtPointer */); |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
64 static void xm_nosel_callback (/* Widget, XtPointer, XtPointer */); |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
65 static void xm_pop_down_callback (/* Widget, XtPointer, XtPointer */); |
5626 | 66 |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
67 static void xm_update_menu (/* widget_instance*, Widget, widget_value*, |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
68 Boolean) */); |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
69 |
5626 | 70 |
71 /* Structures to keep destroyed instances */ | |
72 typedef struct _destroyed_instance | |
73 { | |
74 char* name; | |
75 char* type; | |
76 Widget widget; | |
77 Widget parent; | |
78 Boolean pop_up_p; | |
79 struct _destroyed_instance* next; | |
80 } destroyed_instance; | |
81 | |
82 static destroyed_instance* | |
83 all_destroyed_instances = NULL; | |
84 | |
85 static destroyed_instance* | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
86 make_destroyed_instance (name, type, widget, parent, pop_up_p) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
87 char* name; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
88 char* type; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
89 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
90 Widget parent; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
91 Boolean pop_up_p; |
5626 | 92 { |
93 destroyed_instance* instance = | |
94 (destroyed_instance*)malloc (sizeof (destroyed_instance)); | |
8784 | 95 instance->name = safe_strdup (name); |
96 instance->type = safe_strdup (type); | |
5626 | 97 instance->widget = widget; |
98 instance->parent = parent; | |
99 instance->pop_up_p = pop_up_p; | |
100 instance->next = NULL; | |
101 return instance; | |
102 } | |
103 | |
104 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
105 free_destroyed_instance (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
106 destroyed_instance* instance; |
5626 | 107 { |
108 free (instance->name); | |
109 free (instance->type); | |
110 free (instance); | |
111 } | |
112 | |
113 /* motif utility functions */ | |
114 Widget | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
115 first_child (widget) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
116 Widget widget; |
5626 | 117 { |
118 return ((CompositeWidget)widget)->composite.children [0]; | |
119 } | |
120 | |
121 Boolean | |
15602
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
122 lw_motif_menu_related_event_p (event) |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
123 XEvent event; |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
124 { |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
125 Widget widget = XtWindowToWidget (event.xkey.display,event.xkey.window); |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
126 WidgetClass class = XtClass (widget); |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
127 return |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
128 class == xmMainWindowWidgetClass |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
129 || class == xmRowColumnWidgetClass |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
130 || class == xmMenuShellWidgetClass; |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
131 } |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
132 |
9aa89ea71d5b
(lw_motif_menu_related_event_p): A predicate to identify keyboard events
Miles Bader <miles@gnu.org>
parents:
15375
diff
changeset
|
133 Boolean |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
134 lw_motif_widget_p (widget) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
135 Widget widget; |
5626 | 136 { |
137 return | |
138 XtClass (widget) == xmDialogShellWidgetClass | |
139 || XmIsPrimitive (widget) || XmIsManager (widget) || XmIsGadget (widget); | |
140 } | |
141 | |
142 static XmString | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
143 resource_motif_string (widget, name) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
144 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
145 char* name; |
5626 | 146 { |
147 XtResource resource; | |
148 XmString result = 0; | |
149 | |
150 resource.resource_name = name; | |
151 resource.resource_class = XmCXmString; | |
152 resource.resource_type = XmRXmString; | |
153 resource.resource_size = sizeof (XmString); | |
154 resource.resource_offset = 0; | |
155 resource.default_type = XtRImmediate; | |
156 resource.default_addr = 0; | |
157 | |
158 XtGetSubresources (widget, (XtPointer)&result, "dialogString", | |
159 "DialogString", &resource, 1, NULL, 0); | |
160 return result; | |
161 } | |
162 | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
163 /* Destroy all of the children of WIDGET |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
164 starting with number FIRST_CHILD_TO_DESTROY. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
165 |
5626 | 166 static void |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
167 destroy_all_children (widget, first_child_to_destroy) |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
168 Widget widget; |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
169 int first_child_to_destroy; |
5626 | 170 { |
171 Widget* children; | |
172 unsigned int number; | |
173 int i; | |
174 | |
175 children = XtCompositeChildren (widget, &number); | |
176 if (children) | |
177 { | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
178 XtUnmanageChildren (children + first_child_to_destroy, |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
179 number - first_child_to_destroy); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
180 |
5626 | 181 /* Unmanage all children and destroy them. They will only be |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
182 really destroyed when we get out of DispatchEvent. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
183 for (i = first_child_to_destroy; i < number; i++) |
14931
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
184 { |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
185 Arg al[2]; |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
186 Widget submenu = 0; |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
187 /* Cascade buttons have submenus,and these submenus |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
188 need to be freed. But they are not included in |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
189 XtCompositeChildren. So get it out of the cascade button |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
190 and free it. If this child is not a cascade button, |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
191 then submenu should remain unchanged. */ |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
192 XtSetArg (al[0], XmNsubMenuId, &submenu); |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
193 XtGetValues (children[i], al, 1); |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
194 if (submenu) |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
195 XtDestroyWidget (submenu); |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
196 XtDestroyWidget (children[i]); |
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
197 } |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
198 |
5626 | 199 XtFree ((char *) children); |
200 } | |
201 } | |
202 | |
203 /* update the label of anything subclass of a label */ | |
204 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
205 xm_update_label (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
206 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
207 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
208 widget_value* val; |
5626 | 209 { |
210 XmString res_string = 0; | |
211 XmString built_string = 0; | |
212 XmString key_string = 0; | |
213 Arg al [256]; | |
214 int ac; | |
215 | |
216 ac = 0; | |
217 | |
218 if (val->value) | |
219 { | |
220 res_string = resource_motif_string (widget, val->value); | |
221 | |
222 if (res_string) | |
223 { | |
224 XtSetArg (al [ac], XmNlabelString, res_string); ac++; | |
225 } | |
226 else | |
227 { | |
228 built_string = | |
229 XmStringCreateLtoR (val->value, XmSTRING_DEFAULT_CHARSET); | |
230 XtSetArg (al [ac], XmNlabelString, built_string); ac++; | |
231 } | |
232 XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++; | |
233 } | |
234 | |
235 if (val->key) | |
236 { | |
237 key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET); | |
238 XtSetArg (al [ac], XmNacceleratorText, key_string); ac++; | |
239 } | |
240 | |
241 if (ac) | |
242 XtSetValues (widget, al, ac); | |
243 | |
244 if (built_string) | |
245 XmStringFree (built_string); | |
246 | |
247 if (key_string) | |
248 XmStringFree (key_string); | |
249 } | |
250 | |
251 /* update of list */ | |
252 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
253 xm_update_list (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
254 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
255 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
256 widget_value* val; |
5626 | 257 { |
258 widget_value* cur; | |
259 int i; | |
260 XtRemoveAllCallbacks (widget, XmNsingleSelectionCallback); | |
261 XtAddCallback (widget, XmNsingleSelectionCallback, xm_generic_callback, | |
262 instance); | |
263 for (cur = val->contents, i = 0; cur; cur = cur->next) | |
264 if (cur->value) | |
265 { | |
266 XmString xmstr = XmStringCreate (cur->value, XmSTRING_DEFAULT_CHARSET); | |
267 i += 1; | |
268 XmListAddItem (widget, xmstr, 0); | |
269 if (cur->selected) | |
270 XmListSelectPos (widget, i, False); | |
271 XmStringFree (xmstr); | |
272 } | |
273 } | |
274 | |
275 /* update of buttons */ | |
276 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
277 xm_update_pushbutton (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
278 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
279 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
280 widget_value* val; |
5626 | 281 { |
282 XtVaSetValues (widget, XmNalignment, XmALIGNMENT_CENTER, 0); | |
283 XtRemoveAllCallbacks (widget, XmNactivateCallback); | |
284 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); | |
285 } | |
286 | |
287 static void | |
11862
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
288 xm_update_cascadebutton (instance, widget, val) |
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
289 widget_instance* instance; |
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
290 Widget widget; |
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
291 widget_value* val; |
5626 | 292 { |
293 /* Should also rebuild the menu by calling ...update_menu... */ | |
294 XtRemoveAllCallbacks (widget, XmNcascadingCallback); | |
295 XtAddCallback (widget, XmNcascadingCallback, xm_pull_down_callback, | |
296 instance); | |
297 } | |
298 | |
299 /* update toggle and radiobox */ | |
300 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
301 xm_update_toggle (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
302 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
303 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
304 widget_value* val; |
5626 | 305 { |
306 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); | |
307 XtAddCallback (widget, XmNvalueChangedCallback, | |
308 xm_internal_update_other_instances, instance); | |
309 XtVaSetValues (widget, XmNset, val->selected, | |
310 XmNalignment, XmALIGNMENT_BEGINNING, 0); | |
311 } | |
312 | |
313 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
314 xm_update_radiobox (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
315 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
316 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
317 widget_value* val; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
318 |
5626 | 319 { |
320 Widget toggle; | |
321 widget_value* cur; | |
322 | |
323 /* update the callback */ | |
324 XtRemoveAllCallbacks (widget, XmNentryCallback); | |
325 XtAddCallback (widget, XmNentryCallback, xm_generic_callback, instance); | |
326 | |
327 /* first update all the toggles */ | |
328 /* Energize kernel interface is currently bad. It sets the selected widget | |
329 with the selected flag but returns it by its name. So we currently | |
330 have to support both setting the selection with the selected slot | |
331 of val contents and setting it with the "value" slot of val. The latter | |
332 has a higher priority. This to be removed when the kernel is fixed. */ | |
333 for (cur = val->contents; cur; cur = cur->next) | |
334 { | |
335 toggle = XtNameToWidget (widget, cur->value); | |
336 if (toggle) | |
337 { | |
338 XtVaSetValues (toggle, XmNsensitive, cur->enabled, 0); | |
339 if (!val->value && cur->selected) | |
340 XtVaSetValues (toggle, XmNset, cur->selected, 0); | |
341 if (val->value && strcmp (val->value, cur->value)) | |
342 XtVaSetValues (toggle, XmNset, False, 0); | |
343 } | |
344 } | |
345 | |
346 /* The selected was specified by the value slot */ | |
347 if (val->value) | |
348 { | |
349 toggle = XtNameToWidget (widget, val->value); | |
350 if (toggle) | |
351 XtVaSetValues (toggle, XmNset, True, 0); | |
352 } | |
353 } | |
354 | |
355 /* update a popup menu, pulldown menu or a menubar */ | |
356 static Boolean | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
357 all_dashes_p (s) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
358 char* s; |
5626 | 359 { |
360 char* t; | |
361 for (t = s; *t; t++) | |
362 if (*t != '-') | |
363 return False; | |
364 return True; | |
365 } | |
366 | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
367 /* KEEP_FIRST_CHILDREN gives the number of initial children to keep. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
368 |
5626 | 369 static void |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
370 make_menu_in_widget (instance, widget, val, keep_first_children) |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
371 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
372 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
373 widget_value* val; |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
374 int keep_first_children; |
5626 | 375 { |
376 Widget* children = 0; | |
377 int num_children; | |
378 int child_index; | |
379 widget_value* cur; | |
380 Widget button = 0; | |
381 Widget menu; | |
382 Arg al [256]; | |
383 int ac; | |
384 Boolean menubar_p; | |
385 | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
386 Widget* old_children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
387 unsigned int old_num_children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
388 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
389 old_children = XtCompositeChildren (widget, &old_num_children); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
390 |
5626 | 391 /* Allocate the children array */ |
392 for (num_children = 0, cur = val; cur; num_children++, cur = cur->next); | |
393 children = (Widget*)XtMalloc (num_children * sizeof (Widget)); | |
394 | |
395 /* tricky way to know if this RowColumn is a menubar or a pulldown... */ | |
396 menubar_p = False; | |
397 XtSetArg (al[0], XmNisHomogeneous, &menubar_p); | |
398 XtGetValues (widget, al, 1); | |
399 | |
400 /* add the unmap callback for popups and pulldowns */ | |
401 /*** this sounds bogus ***/ | |
402 if (!menubar_p) | |
403 XtAddCallback (XtParent (widget), XmNpopdownCallback, | |
404 xm_pop_down_callback, (XtPointer)instance); | |
405 | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
406 /* Preserve the first KEEP_FIRST_CHILDREN old children. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
407 for (child_index = 0, cur = val; child_index < keep_first_children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
408 child_index++, cur = cur->next) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
409 children[child_index] = old_children[child_index]; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
410 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
411 /* Check that those are all we have |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
412 (the caller should have deleted the rest). */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
413 if (old_num_children != keep_first_children) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
414 abort (); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
415 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
416 /* Create the rest. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
417 for (child_index = keep_first_children; cur; child_index++, cur = cur->next) |
5626 | 418 { |
419 ac = 0; | |
420 XtSetArg (al [ac], XmNsensitive, cur->enabled); ac++; | |
421 XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; | |
422 XtSetArg (al [ac], XmNuserData, cur->call_data); ac++; | |
423 | |
9835
d2250d1b0f48
(make_menu_in_widget): Differentiate a separator entry ("--") from a
Paul Reilly <pmr@pajato.com>
parents:
9825
diff
changeset
|
424 if (instance->pop_up_p && !cur->contents && !cur->call_data |
d2250d1b0f48
(make_menu_in_widget): Differentiate a separator entry ("--") from a
Paul Reilly <pmr@pajato.com>
parents:
9825
diff
changeset
|
425 && !all_dashes_p (cur->name)) |
9224
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
426 { |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
427 ac = 0; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
428 XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
429 button = XmCreateLabel (widget, cur->name, al, ac); |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
430 } |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
431 else if (all_dashes_p (cur->name)) |
5626 | 432 { |
433 button = XmCreateSeparator (widget, cur->name, NULL, 0); | |
434 } | |
435 else if (!cur->contents) | |
436 { | |
437 if (menubar_p) | |
438 button = XmCreateCascadeButton (widget, cur->name, al, ac); | |
439 else if (!cur->call_data) | |
440 button = XmCreateLabel (widget, cur->name, al, ac); | |
441 else | |
442 button = XmCreatePushButtonGadget (widget, cur->name, al, ac); | |
443 | |
444 xm_update_label (instance, button, cur); | |
445 | |
446 /* don't add a callback to a simple label */ | |
447 if (cur->call_data) | |
448 XtAddCallback (button, XmNactivateCallback, xm_generic_callback, | |
449 (XtPointer)instance); | |
450 } | |
451 else | |
452 { | |
11435
efaaecd960ae
(update_one_menu_entry, make_menu_in_widget):
Richard M. Stallman <rms@gnu.org>
parents:
11299
diff
changeset
|
453 menu = XmCreatePulldownMenu (widget, cur->name, NULL, 0); |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
454 make_menu_in_widget (instance, menu, cur->contents, 0); |
15375
1beabd8b78a1
(make_menu_in_widget): Set mapping delay
Richard M. Stallman <rms@gnu.org>
parents:
14931
diff
changeset
|
455 XtSetArg (al [ac], XmNsubMenuId, menu); ac++; |
1beabd8b78a1
(make_menu_in_widget): Set mapping delay
Richard M. Stallman <rms@gnu.org>
parents:
14931
diff
changeset
|
456 /* non-zero values don't work reliably in |
1beabd8b78a1
(make_menu_in_widget): Set mapping delay
Richard M. Stallman <rms@gnu.org>
parents:
14931
diff
changeset
|
457 conjunction with Emacs' event loop */ |
1beabd8b78a1
(make_menu_in_widget): Set mapping delay
Richard M. Stallman <rms@gnu.org>
parents:
14931
diff
changeset
|
458 XtSetArg (al [ac], XmNmappingDelay, 0); ac++; |
14931
0706926a11cb
(destroy_all_children): When freeing a cascade button, free its submenu too.
Richard M. Stallman <rms@gnu.org>
parents:
14877
diff
changeset
|
459 button = XmCreateCascadeButtonGadget (widget, cur->name, al, ac); |
5626 | 460 |
461 xm_update_label (instance, button, cur); | |
462 | |
463 XtAddCallback (button, XmNcascadingCallback, xm_pull_down_callback, | |
464 (XtPointer)instance); | |
465 } | |
466 | |
467 children [child_index] = button; | |
468 } | |
469 | |
470 XtManageChildren (children, num_children); | |
471 | |
472 /* Last entry is the help button. Has to be done after managing | |
473 * the buttons otherwise the menubar is only 4 pixels high... */ | |
474 if (button) | |
475 { | |
476 ac = 0; | |
477 XtSetArg (al [ac], XmNmenuHelpWidget, button); ac++; | |
478 XtSetValues (widget, al, ac); | |
479 } | |
480 | |
481 XtFree ((char *) children); | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
482 if (old_children) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
483 XtFree ((char *) old_children); |
5626 | 484 } |
485 | |
486 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
487 update_one_menu_entry (instance, widget, val, deep_p) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
488 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
489 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
490 widget_value* val; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
491 Boolean deep_p; |
5626 | 492 { |
493 Arg al [256]; | |
494 int ac; | |
495 Widget menu; | |
496 widget_value* contents; | |
497 | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
498 if (val->this_one_change == NO_CHANGE) |
5626 | 499 return; |
500 | |
501 /* update the sensitivity and userdata */ | |
502 /* Common to all widget types */ | |
503 XtVaSetValues (widget, | |
504 XmNsensitive, val->enabled, | |
505 XmNuserData, val->call_data, | |
506 0); | |
507 | |
508 /* update the menu button as a label. */ | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
509 if (val->this_one_change >= VISIBLE_CHANGE) |
5626 | 510 xm_update_label (instance, widget, val); |
511 | |
512 /* update the pulldown/pullaside as needed */ | |
513 ac = 0; | |
514 menu = NULL; | |
515 XtSetArg (al [ac], XmNsubMenuId, &menu); ac++; | |
516 XtGetValues (widget, al, ac); | |
517 | |
518 contents = val->contents; | |
519 | |
520 if (!menu) | |
521 { | |
522 if (contents) | |
523 { | |
11435
efaaecd960ae
(update_one_menu_entry, make_menu_in_widget):
Richard M. Stallman <rms@gnu.org>
parents:
11299
diff
changeset
|
524 menu = XmCreatePulldownMenu (XtParent (widget), XtName (widget), NULL, 0); |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
525 make_menu_in_widget (instance, menu, contents, 0); |
5626 | 526 ac = 0; |
527 XtSetArg (al [ac], XmNsubMenuId, menu); ac++; | |
528 XtSetValues (widget, al, ac); | |
529 } | |
530 } | |
531 else if (!contents) | |
532 { | |
533 ac = 0; | |
534 XtSetArg (al [ac], XmNsubMenuId, NULL); ac++; | |
535 XtSetValues (widget, al, ac); | |
536 XtDestroyWidget (menu); | |
537 } | |
538 else if (deep_p && contents->change != NO_CHANGE) | |
539 xm_update_menu (instance, menu, val, 1); | |
540 } | |
541 | |
542 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
543 xm_update_menu (instance, widget, val, deep_p) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
544 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
545 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
546 widget_value* val; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
547 Boolean deep_p; |
5626 | 548 { |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
549 Widget* children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
550 unsigned int num_children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
551 int num_children_to_keep = 0; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
552 int i; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
553 widget_value* cur; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
554 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
555 children = XtCompositeChildren (widget, &num_children); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
556 |
5626 | 557 /* Widget is a RowColumn widget whose contents have to be updated |
558 * to reflect the list of items in val->contents */ | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
559 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
560 /* See how many buttons we can keep, and how many we |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
561 must completely replace. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
562 if (val->contents == 0) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
563 num_children_to_keep = 0; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
564 else if (val->contents->change == STRUCTURAL_CHANGE) |
5626 | 565 { |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
566 if (children) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
567 { |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
568 for (i = 0, cur = val->contents; i < num_children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
569 i++, cur = cur->next) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
570 { |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
571 if (cur->this_one_change == STRUCTURAL_CHANGE) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
572 break; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
573 } |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
574 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
575 num_children_to_keep = i; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
576 } |
5626 | 577 } |
578 else | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
579 num_children_to_keep = num_children; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
580 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
581 /* Update all the buttons of the RowColumn, in order, |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
582 except for those we are going to replace entirely. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
583 if (children) |
5626 | 584 { |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
585 for (i = 0, cur = val->contents; i < num_children_to_keep; i++) |
5626 | 586 { |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
587 if (!cur) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
588 abort (); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
589 if (children [i]->core.being_destroyed |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
590 || strcmp (XtName (children [i]), cur->name)) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
591 continue; |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
592 update_one_menu_entry (instance, children [i], cur, deep_p); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
593 cur = cur->next; |
5626 | 594 } |
595 } | |
14877
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
596 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
597 /* Now replace from scratch all the buttons after the last |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
598 place that the top-level structure changed. */ |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
599 if (val->contents->change == STRUCTURAL_CHANGE) |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
600 { |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
601 destroy_all_children (widget, num_children_to_keep); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
602 make_menu_in_widget (instance, widget, val->contents, |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
603 num_children_to_keep); |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
604 } |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
605 |
62fc4d7a846f
(destroy_all_children): New arg first_child_to_destroy.
Richard M. Stallman <rms@gnu.org>
parents:
14186
diff
changeset
|
606 XtFree ((char *) children); |
5626 | 607 } |
608 | |
609 | |
610 /* update text widgets */ | |
611 | |
612 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
613 xm_update_text (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
614 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
615 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
616 widget_value* val; |
5626 | 617 { |
618 XmTextSetString (widget, val->value ? val->value : ""); | |
619 XtRemoveAllCallbacks (widget, XmNactivateCallback); | |
620 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); | |
621 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); | |
622 XtAddCallback (widget, XmNvalueChangedCallback, | |
623 xm_internal_update_other_instances, instance); | |
624 } | |
625 | |
626 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
627 xm_update_text_field (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
628 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
629 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
630 widget_value* val; |
5626 | 631 { |
632 XmTextFieldSetString (widget, val->value ? val->value : ""); | |
633 XtRemoveAllCallbacks (widget, XmNactivateCallback); | |
634 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); | |
635 XtRemoveAllCallbacks (widget, XmNvalueChangedCallback); | |
636 XtAddCallback (widget, XmNvalueChangedCallback, | |
637 xm_internal_update_other_instances, instance); | |
638 } | |
639 | |
640 | |
641 /* update a motif widget */ | |
642 | |
643 void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
644 xm_update_one_widget (instance, widget, val, deep_p) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
645 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
646 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
647 widget_value* val; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
648 Boolean deep_p; |
5626 | 649 { |
650 WidgetClass class; | |
651 | |
652 /* Mark as not edited */ | |
653 val->edited = False; | |
654 | |
655 /* Common to all widget types */ | |
656 XtVaSetValues (widget, | |
657 XmNsensitive, val->enabled, | |
658 XmNuserData, val->call_data, | |
659 0); | |
660 | |
661 /* Common to all label like widgets */ | |
662 if (XtIsSubclass (widget, xmLabelWidgetClass)) | |
663 xm_update_label (instance, widget, val); | |
664 | |
665 class = XtClass (widget); | |
666 /* Class specific things */ | |
667 if (class == xmPushButtonWidgetClass || | |
668 class == xmArrowButtonWidgetClass) | |
669 { | |
670 xm_update_pushbutton (instance, widget, val); | |
671 } | |
672 else if (class == xmCascadeButtonWidgetClass) | |
673 { | |
674 xm_update_cascadebutton (instance, widget, val); | |
675 } | |
676 else if (class == xmToggleButtonWidgetClass | |
677 || class == xmToggleButtonGadgetClass) | |
678 { | |
679 xm_update_toggle (instance, widget, val); | |
680 } | |
681 else if (class == xmRowColumnWidgetClass) | |
682 { | |
683 Boolean radiobox = 0; | |
684 int ac = 0; | |
685 Arg al [1]; | |
686 | |
687 XtSetArg (al [ac], XmNradioBehavior, &radiobox); ac++; | |
688 XtGetValues (widget, al, ac); | |
689 | |
690 if (radiobox) | |
691 xm_update_radiobox (instance, widget, val); | |
692 else | |
693 xm_update_menu (instance, widget, val, deep_p); | |
694 } | |
695 else if (class == xmTextWidgetClass) | |
696 { | |
697 xm_update_text (instance, widget, val); | |
698 } | |
699 else if (class == xmTextFieldWidgetClass) | |
700 { | |
701 xm_update_text_field (instance, widget, val); | |
702 } | |
703 else if (class == xmListWidgetClass) | |
704 { | |
705 xm_update_list (instance, widget, val); | |
706 } | |
707 } | |
708 | |
709 /* getting the value back */ | |
710 void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
711 xm_update_one_value (instance, widget, val) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
712 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
713 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
714 widget_value* val; |
5626 | 715 { |
716 WidgetClass class = XtClass (widget); | |
717 widget_value *old_wv; | |
718 | |
719 /* copy the call_data slot into the "return" widget_value */ | |
720 for (old_wv = instance->info->val->contents; old_wv; old_wv = old_wv->next) | |
721 if (!strcmp (val->name, old_wv->name)) | |
722 { | |
723 val->call_data = old_wv->call_data; | |
724 break; | |
725 } | |
726 | |
727 if (class == xmToggleButtonWidgetClass || class == xmToggleButtonGadgetClass) | |
728 { | |
729 XtVaGetValues (widget, XmNset, &val->selected, 0); | |
730 val->edited = True; | |
731 } | |
732 else if (class == xmTextWidgetClass) | |
733 { | |
734 if (val->value) | |
735 free (val->value); | |
736 val->value = XmTextGetString (widget); | |
737 val->edited = True; | |
738 } | |
739 else if (class == xmTextFieldWidgetClass) | |
740 { | |
741 if (val->value) | |
742 free (val->value); | |
743 val->value = XmTextFieldGetString (widget); | |
744 val->edited = True; | |
745 } | |
746 else if (class == xmRowColumnWidgetClass) | |
747 { | |
748 Boolean radiobox = 0; | |
749 int ac = 0; | |
750 Arg al [1]; | |
751 | |
752 XtSetArg (al [ac], XmNradioBehavior, &radiobox); ac++; | |
753 XtGetValues (widget, al, ac); | |
754 | |
755 if (radiobox) | |
756 { | |
757 CompositeWidget radio = (CompositeWidget)widget; | |
758 int i; | |
759 for (i = 0; i < radio->composite.num_children; i++) | |
760 { | |
761 int set = False; | |
762 Widget toggle = radio->composite.children [i]; | |
763 | |
764 XtVaGetValues (toggle, XmNset, &set, 0); | |
765 if (set) | |
766 { | |
767 if (val->value) | |
768 free (val->value); | |
8784 | 769 val->value = safe_strdup (XtName (toggle)); |
5626 | 770 } |
771 } | |
772 val->edited = True; | |
773 } | |
774 } | |
775 else if (class == xmListWidgetClass) | |
776 { | |
777 int pos_cnt; | |
778 int* pos_list; | |
779 if (XmListGetSelectedPos (widget, &pos_list, &pos_cnt)) | |
780 { | |
781 int i; | |
782 widget_value* cur; | |
783 for (cur = val->contents, i = 0; cur; cur = cur->next) | |
784 if (cur->value) | |
785 { | |
786 int j; | |
787 cur->selected = False; | |
788 i += 1; | |
789 for (j = 0; j < pos_cnt; j++) | |
790 if (pos_list [j] == i) | |
791 { | |
792 cur->selected = True; | |
8784 | 793 val->value = safe_strdup (cur->name); |
5626 | 794 } |
795 } | |
796 val->edited = 1; | |
797 XtFree ((char *) pos_list); | |
798 } | |
799 } | |
800 } | |
801 | |
802 | |
803 /* This function is for activating a button from a program. It's wrong because | |
804 we pass a NULL argument in the call_data which is not Motif compatible. | |
805 This is used from the XmNdefaultAction callback of the List widgets to | |
14018 | 806 have a double-click put down a dialog box like the button would do. |
5626 | 807 I could not find a way to do that with accelerators. |
808 */ | |
809 static void | |
11862
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
810 activate_button (widget, closure, call_data) |
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
811 Widget widget; |
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
812 XtPointer closure; |
10a973a88e87
(activate_button, xm_update_cascadebutton): Don't use prototype.
Karl Heuer <kwzh@gnu.org>
parents:
11435
diff
changeset
|
813 XtPointer call_data; |
5626 | 814 { |
815 Widget button = (Widget)closure; | |
816 XtCallCallbacks (button, XmNactivateCallback, NULL); | |
817 } | |
818 | |
819 /* creation functions */ | |
820 | |
821 /* dialogs */ | |
822 static Widget | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
823 make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
824 radio_box, list, left_buttons, right_buttons) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
825 char* name; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
826 Widget parent; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
827 Boolean pop_up_p; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
828 char* shell_title; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
829 char* icon_name; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
830 Boolean text_input_slot; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
831 Boolean radio_box; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
832 Boolean list; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
833 int left_buttons; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
834 int right_buttons; |
5626 | 835 { |
836 Widget result; | |
837 Widget form; | |
838 Widget row; | |
839 Widget icon; | |
840 Widget icon_separator; | |
841 Widget message; | |
842 Widget value = 0; | |
843 Widget separator; | |
844 Widget button = 0; | |
845 Widget children [16]; /* for the final XtManageChildren */ | |
846 int n_children; | |
847 Arg al[64]; /* Arg List */ | |
848 int ac; /* Arg Count */ | |
849 int i; | |
850 | |
851 if (pop_up_p) | |
852 { | |
853 ac = 0; | |
854 XtSetArg(al[ac], XmNtitle, shell_title); ac++; | |
855 XtSetArg(al[ac], XtNallowShellResize, True); ac++; | |
856 XtSetArg(al[ac], XmNdeleteResponse, XmUNMAP); ac++; | |
857 result = XmCreateDialogShell (parent, "dialog", al, ac); | |
858 ac = 0; | |
859 XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++; | |
860 /* XtSetArg(al[ac], XmNautoUnmanage, TRUE); ac++; */ /* ####is this ok? */ | |
861 XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; | |
862 form = XmCreateForm (result, shell_title, al, ac); | |
863 } | |
864 else | |
865 { | |
866 ac = 0; | |
867 XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++; | |
868 XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; | |
869 form = XmCreateForm (parent, shell_title, al, ac); | |
870 result = form; | |
871 } | |
872 | |
8884 | 873 n_children = left_buttons + right_buttons + 1; |
5626 | 874 ac = 0; |
8884 | 875 XtSetArg(al[ac], XmNpacking, n_children == 3? |
876 XmPACK_COLUMN: XmPACK_TIGHT); ac++; | |
877 XtSetArg(al[ac], XmNorientation, n_children == 3? | |
878 XmVERTICAL: XmHORIZONTAL); ac++; | |
5626 | 879 XtSetArg(al[ac], XmNnumColumns, left_buttons + right_buttons + 1); ac++; |
880 XtSetArg(al[ac], XmNmarginWidth, 0); ac++; | |
881 XtSetArg(al[ac], XmNmarginHeight, 0); ac++; | |
882 XtSetArg(al[ac], XmNspacing, 13); ac++; | |
883 XtSetArg(al[ac], XmNadjustLast, False); ac++; | |
884 XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; | |
885 XtSetArg(al[ac], XmNisAligned, True); ac++; | |
886 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; | |
887 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++; | |
888 XtSetArg(al[ac], XmNbottomOffset, 13); ac++; | |
889 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; | |
890 XtSetArg(al[ac], XmNleftOffset, 13); ac++; | |
891 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; | |
892 XtSetArg(al[ac], XmNrightOffset, 13); ac++; | |
893 row = XmCreateRowColumn (form, "row", al, ac); | |
894 | |
895 n_children = 0; | |
896 for (i = 0; i < left_buttons; i++) | |
897 { | |
898 char button_name [16]; | |
899 sprintf (button_name, "button%d", i + 1); | |
900 ac = 0; | |
901 if (i == 0) | |
902 { | |
903 XtSetArg(al[ac], XmNhighlightThickness, 1); ac++; | |
904 XtSetArg(al[ac], XmNshowAsDefault, TRUE); ac++; | |
905 } | |
8884 | 906 XtSetArg(al[ac], XmNmarginWidth, 10); ac++; |
5626 | 907 XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; |
908 children [n_children] = XmCreatePushButton (row, button_name, al, ac); | |
909 | |
910 if (i == 0) | |
911 { | |
912 button = children [n_children]; | |
913 ac = 0; | |
914 XtSetArg(al[ac], XmNdefaultButton, button); ac++; | |
915 XtSetValues (row, al, ac); | |
916 } | |
917 | |
918 n_children++; | |
919 } | |
920 | |
14018 | 921 /* invisible separator button */ |
5626 | 922 ac = 0; |
923 XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++; | |
924 children [n_children] = XmCreateLabel (row, "separator_button", al, ac); | |
925 n_children++; | |
926 | |
927 for (i = 0; i < right_buttons; i++) | |
928 { | |
929 char button_name [16]; | |
930 sprintf (button_name, "button%d", left_buttons + i + 1); | |
931 ac = 0; | |
8884 | 932 XtSetArg(al[ac], XmNmarginWidth, 10); ac++; |
5626 | 933 XtSetArg(al[ac], XmNnavigationType, XmTAB_GROUP); ac++; |
934 children [n_children] = XmCreatePushButton (row, button_name, al, ac); | |
935 if (! button) button = children [n_children]; | |
936 n_children++; | |
937 } | |
938 | |
939 XtManageChildren (children, n_children); | |
940 | |
941 ac = 0; | |
942 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; | |
943 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; | |
944 XtSetArg(al[ac], XmNbottomOffset, 13); ac++; | |
945 XtSetArg(al[ac], XmNbottomWidget, row); ac++; | |
946 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; | |
947 XtSetArg(al[ac], XmNleftOffset, 0); ac++; | |
948 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; | |
949 XtSetArg(al[ac], XmNrightOffset, 0); ac++; | |
950 separator = XmCreateSeparator (form, "", al, ac); | |
951 | |
952 ac = 0; | |
953 XtSetArg(al[ac], XmNlabelType, XmPIXMAP); ac++; | |
954 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; | |
955 XtSetArg(al[ac], XmNtopOffset, 13); ac++; | |
956 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++; | |
957 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++; | |
958 XtSetArg(al[ac], XmNleftOffset, 13); ac++; | |
959 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++; | |
960 icon = XmCreateLabel (form, icon_name, al, ac); | |
961 | |
962 ac = 0; | |
963 XtSetArg(al[ac], XmNmappedWhenManaged, FALSE); ac++; | |
964 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++; | |
965 XtSetArg(al[ac], XmNtopOffset, 6); ac++; | |
966 XtSetArg(al[ac], XmNtopWidget, icon); ac++; | |
967 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; | |
968 XtSetArg(al[ac], XmNbottomOffset, 6); ac++; | |
969 XtSetArg(al[ac], XmNbottomWidget, separator); ac++; | |
970 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++; | |
971 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++; | |
972 icon_separator = XmCreateLabel (form, "", al, ac); | |
973 | |
974 if (text_input_slot) | |
975 { | |
976 ac = 0; | |
977 XtSetArg(al[ac], XmNcolumns, 50); ac++; | |
978 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; | |
979 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; | |
980 XtSetArg(al[ac], XmNbottomOffset, 13); ac++; | |
981 XtSetArg(al[ac], XmNbottomWidget, separator); ac++; | |
982 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; | |
983 XtSetArg(al[ac], XmNleftOffset, 13); ac++; | |
984 XtSetArg(al[ac], XmNleftWidget, icon); ac++; | |
985 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; | |
986 XtSetArg(al[ac], XmNrightOffset, 13); ac++; | |
987 value = XmCreateTextField (form, "value", al, ac); | |
988 } | |
989 else if (radio_box) | |
990 { | |
991 Widget radio_butt; | |
992 ac = 0; | |
993 XtSetArg(al[ac], XmNmarginWidth, 0); ac++; | |
994 XtSetArg(al[ac], XmNmarginHeight, 0); ac++; | |
995 XtSetArg(al[ac], XmNspacing, 13); ac++; | |
996 XtSetArg(al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++; | |
997 XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++; | |
998 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; | |
999 XtSetArg(al[ac], XmNbottomOffset, 13); ac++; | |
1000 XtSetArg(al[ac], XmNbottomWidget, separator); ac++; | |
1001 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; | |
1002 XtSetArg(al[ac], XmNleftOffset, 13); ac++; | |
1003 XtSetArg(al[ac], XmNleftWidget, icon); ac++; | |
1004 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; | |
1005 XtSetArg(al[ac], XmNrightOffset, 13); ac++; | |
1006 value = XmCreateRadioBox (form, "radiobutton1", al, ac); | |
1007 ac = 0; | |
1008 i = 0; | |
1009 radio_butt = XmCreateToggleButtonGadget (value, "radio1", al, ac); | |
1010 children [i++] = radio_butt; | |
1011 radio_butt = XmCreateToggleButtonGadget (value, "radio2", al, ac); | |
1012 children [i++] = radio_butt; | |
1013 radio_butt = XmCreateToggleButtonGadget (value, "radio3", al, ac); | |
1014 children [i++] = radio_butt; | |
1015 XtManageChildren (children, i); | |
1016 } | |
1017 else if (list) | |
1018 { | |
1019 ac = 0; | |
1020 XtSetArg(al[ac], XmNvisibleItemCount, 5); ac++; | |
1021 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; | |
1022 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; | |
1023 XtSetArg(al[ac], XmNbottomOffset, 13); ac++; | |
1024 XtSetArg(al[ac], XmNbottomWidget, separator); ac++; | |
1025 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; | |
1026 XtSetArg(al[ac], XmNleftOffset, 13); ac++; | |
1027 XtSetArg(al[ac], XmNleftWidget, icon); ac++; | |
1028 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; | |
1029 XtSetArg(al[ac], XmNrightOffset, 13); ac++; | |
1030 value = XmCreateScrolledList (form, "list", al, ac); | |
1031 | |
1032 /* this is the easiest way I found to have the dble click in the | |
1033 list activate the default button */ | |
1034 XtAddCallback (value, XmNdefaultActionCallback, activate_button, button); | |
1035 } | |
1036 | |
1037 ac = 0; | |
1038 XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; | |
1039 XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; | |
1040 XtSetArg(al[ac], XmNtopOffset, 13); ac++; | |
1041 XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; | |
1042 XtSetArg(al[ac], XmNbottomOffset, 13); ac++; | |
1043 XtSetArg(al[ac], XmNbottomWidget, | |
1044 text_input_slot || radio_box || list ? value : separator); ac++; | |
1045 XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++; | |
1046 XtSetArg(al[ac], XmNleftOffset, 13); ac++; | |
1047 XtSetArg(al[ac], XmNleftWidget, icon); ac++; | |
1048 XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; | |
1049 XtSetArg(al[ac], XmNrightOffset, 13); ac++; | |
1050 message = XmCreateLabel (form, "message", al, ac); | |
1051 | |
1052 if (list) | |
1053 XtManageChild (value); | |
1054 | |
1055 i = 0; | |
1056 children [i] = row; i++; | |
1057 children [i] = separator; i++; | |
1058 if (text_input_slot || radio_box) | |
1059 { | |
1060 children [i] = value; i++; | |
1061 } | |
1062 children [i] = message; i++; | |
1063 children [i] = icon; i++; | |
1064 children [i] = icon_separator; i++; | |
1065 XtManageChildren (children, i); | |
1066 | |
1067 if (text_input_slot || list) | |
1068 { | |
1069 XtInstallAccelerators (value, button); | |
1070 XtSetKeyboardFocus (result, value); | |
1071 } | |
1072 else | |
1073 { | |
1074 XtInstallAccelerators (form, button); | |
1075 XtSetKeyboardFocus (result, button); | |
1076 } | |
1077 | |
1078 return result; | |
1079 } | |
1080 | |
1081 static destroyed_instance* | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1082 find_matching_instance (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1083 widget_instance* instance; |
5626 | 1084 { |
1085 destroyed_instance* cur; | |
1086 destroyed_instance* prev; | |
1087 char* type = instance->info->type; | |
1088 char* name = instance->info->name; | |
1089 | |
1090 for (prev = NULL, cur = all_destroyed_instances; | |
1091 cur; | |
1092 prev = cur, cur = cur->next) | |
1093 { | |
1094 if (!strcmp (cur->name, name) | |
1095 && !strcmp (cur->type, type) | |
1096 && cur->parent == instance->parent | |
1097 && cur->pop_up_p == instance->pop_up_p) | |
1098 { | |
1099 if (prev) | |
1100 prev->next = cur->next; | |
1101 else | |
1102 all_destroyed_instances = cur->next; | |
1103 return cur; | |
1104 } | |
1105 /* do some cleanup */ | |
1106 else if (!cur->widget) | |
1107 { | |
1108 if (prev) | |
1109 prev->next = cur->next; | |
1110 else | |
1111 all_destroyed_instances = cur->next; | |
1112 free_destroyed_instance (cur); | |
1113 cur = prev ? prev : all_destroyed_instances; | |
1114 } | |
1115 } | |
1116 return NULL; | |
1117 } | |
1118 | |
1119 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1120 mark_dead_instance_destroyed (widget, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1121 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1122 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1123 XtPointer call_data; |
5626 | 1124 { |
1125 destroyed_instance* instance = (destroyed_instance*)closure; | |
1126 instance->widget = NULL; | |
1127 } | |
1128 | |
1129 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1130 recenter_widget (widget) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1131 Widget widget; |
5626 | 1132 { |
1133 Widget parent = XtParent (widget); | |
1134 Screen* screen = XtScreen (widget); | |
1135 Dimension screen_width = WidthOfScreen (screen); | |
1136 Dimension screen_height = HeightOfScreen (screen); | |
1137 Dimension parent_width = 0; | |
1138 Dimension parent_height = 0; | |
1139 Dimension child_width = 0; | |
1140 Dimension child_height = 0; | |
1141 Position x; | |
1142 Position y; | |
1143 | |
1144 XtVaGetValues (widget, XtNwidth, &child_width, XtNheight, &child_height, 0); | |
1145 XtVaGetValues (parent, XtNwidth, &parent_width, XtNheight, &parent_height, | |
1146 0); | |
1147 | |
1148 x = (((Position)parent_width) - ((Position)child_width)) / 2; | |
1149 y = (((Position)parent_height) - ((Position)child_height)) / 2; | |
1150 | |
1151 XtTranslateCoords (parent, x, y, &x, &y); | |
1152 | |
1153 if (x + child_width > screen_width) | |
1154 x = screen_width - child_width; | |
1155 if (x < 0) | |
1156 x = 0; | |
1157 | |
1158 if (y + child_height > screen_height) | |
1159 y = screen_height - child_height; | |
1160 if (y < 0) | |
1161 y = 0; | |
1162 | |
1163 XtVaSetValues (widget, XtNx, x, XtNy, y, 0); | |
1164 } | |
1165 | |
1166 static Widget | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1167 recycle_instance (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1168 destroyed_instance* instance; |
5626 | 1169 { |
1170 Widget widget = instance->widget; | |
1171 | |
1172 /* widget is NULL if the parent was destroyed. */ | |
1173 if (widget) | |
1174 { | |
1175 Widget focus; | |
1176 Widget separator; | |
1177 | |
1178 /* Remove the destroy callback as the instance is not in the list | |
1179 anymore */ | |
1180 XtRemoveCallback (instance->parent, XtNdestroyCallback, | |
1181 mark_dead_instance_destroyed, | |
1182 (XtPointer)instance); | |
1183 | |
1184 /* Give the focus to the initial item */ | |
1185 focus = XtNameToWidget (widget, "*value"); | |
1186 if (!focus) | |
1187 focus = XtNameToWidget (widget, "*button1"); | |
1188 if (focus) | |
1189 XtSetKeyboardFocus (widget, focus); | |
1190 | |
1191 /* shrink the separator label back to their original size */ | |
1192 separator = XtNameToWidget (widget, "*separator_button"); | |
1193 if (separator) | |
1194 XtVaSetValues (separator, XtNwidth, 5, XtNheight, 5, 0); | |
1195 | |
1196 /* Center the dialog in its parent */ | |
1197 recenter_widget (widget); | |
1198 } | |
1199 free_destroyed_instance (instance); | |
1200 return widget; | |
1201 } | |
1202 | |
1203 Widget | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1204 xm_create_dialog (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1205 widget_instance* instance; |
5626 | 1206 { |
1207 char* name = instance->info->type; | |
1208 Widget parent = instance->parent; | |
1209 Widget widget; | |
1210 Boolean pop_up_p = instance->pop_up_p; | |
1211 char* shell_name = 0; | |
1212 char* icon_name; | |
1213 Boolean text_input_slot = False; | |
1214 Boolean radio_box = False; | |
1215 Boolean list = False; | |
1216 int total_buttons; | |
1217 int left_buttons = 0; | |
1218 int right_buttons = 1; | |
1219 destroyed_instance* dead_one; | |
1220 | |
1221 /* try to find a widget to recycle */ | |
1222 dead_one = find_matching_instance (instance); | |
1223 if (dead_one) | |
1224 { | |
1225 Widget recycled_widget = recycle_instance (dead_one); | |
1226 if (recycled_widget) | |
1227 return recycled_widget; | |
1228 } | |
1229 | |
1230 switch (name [0]){ | |
1231 case 'E': case 'e': | |
1232 icon_name = "dbox-error"; | |
1233 shell_name = "Error"; | |
1234 break; | |
1235 | |
1236 case 'I': case 'i': | |
1237 icon_name = "dbox-info"; | |
1238 shell_name = "Information"; | |
1239 break; | |
1240 | |
1241 case 'L': case 'l': | |
1242 list = True; | |
1243 icon_name = "dbox-question"; | |
1244 shell_name = "Prompt"; | |
1245 break; | |
1246 | |
1247 case 'P': case 'p': | |
1248 text_input_slot = True; | |
1249 icon_name = "dbox-question"; | |
1250 shell_name = "Prompt"; | |
1251 break; | |
1252 | |
1253 case 'Q': case 'q': | |
1254 icon_name = "dbox-question"; | |
1255 shell_name = "Question"; | |
1256 break; | |
1257 } | |
1258 | |
1259 total_buttons = name [1] - '0'; | |
1260 | |
1261 if (name [3] == 'T' || name [3] == 't') | |
1262 { | |
1263 text_input_slot = False; | |
1264 radio_box = True; | |
1265 } | |
1266 else if (name [3]) | |
1267 right_buttons = name [4] - '0'; | |
1268 | |
1269 left_buttons = total_buttons - right_buttons; | |
1270 | |
1271 widget = make_dialog (name, parent, pop_up_p, | |
1272 shell_name, icon_name, text_input_slot, radio_box, | |
1273 list, left_buttons, right_buttons); | |
1274 | |
1275 XtAddCallback (widget, XmNpopdownCallback, xm_nosel_callback, | |
1276 (XtPointer) instance); | |
1277 return widget; | |
1278 } | |
1279 | |
1280 static Widget | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1281 make_menubar (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1282 widget_instance* instance; |
5626 | 1283 { |
1284 return XmCreateMenuBar (instance->parent, instance->info->name, NULL, 0); | |
1285 } | |
1286 | |
1287 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1288 remove_grabs (shell, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1289 Widget shell; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1290 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1291 XtPointer call_data; |
5626 | 1292 { |
11245
5fdf816307c6
(remove_grabs): Use type Widget for `menu'.
Richard M. Stallman <rms@gnu.org>
parents:
9835
diff
changeset
|
1293 Widget menu = (Widget) closure; |
5fdf816307c6
(remove_grabs): Use type Widget for `menu'.
Richard M. Stallman <rms@gnu.org>
parents:
9835
diff
changeset
|
1294 XmRemoveFromPostFromList (menu, XtParent (XtParent (menu))); |
5626 | 1295 } |
1296 | |
1297 static Widget | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1298 make_popup_menu (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1299 widget_instance* instance; |
5626 | 1300 { |
1301 Widget parent = instance->parent; | |
1302 Window parent_window = parent->core.window; | |
1303 Widget result; | |
1304 | |
1305 /* sets the parent window to 0 to fool Motif into not generating a grab */ | |
1306 parent->core.window = 0; | |
1307 result = XmCreatePopupMenu (parent, instance->info->name, NULL, 0); | |
1308 XtAddCallback (XtParent (result), XmNpopdownCallback, remove_grabs, | |
1309 (XtPointer)result); | |
1310 parent->core.window = parent_window; | |
1311 return result; | |
1312 } | |
8784 | 1313 static Widget |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1314 make_main (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1315 widget_instance* instance; |
8784 | 1316 { |
1317 Widget parent = instance->parent; | |
1318 Widget result; | |
1319 Arg al[2]; | |
1320 int ac; | |
1321 | |
1322 ac = 0; | |
1323 XtSetArg (al[ac], XtNborderWidth, 0); ac++; | |
1324 XtSetArg (al[ac], XmNspacing, 0); ac++; | |
1325 result = XmCreateMainWindow (parent, instance->info->name, al, ac); | |
1326 return result; | |
1327 } | |
5626 | 1328 |
1329 /* Table of functions to create widgets */ | |
1330 | |
1331 #ifdef ENERGIZE | |
1332 | |
1333 /* interface with the XDesigner generated functions */ | |
1334 typedef Widget (*widget_maker) (Widget); | |
1335 extern Widget create_project_p_sheet (Widget parent); | |
1336 extern Widget create_debugger_p_sheet (Widget parent); | |
1337 extern Widget create_breaklist_p_sheet (Widget parent); | |
1338 extern Widget create_le_browser_p_sheet (Widget parent); | |
1339 extern Widget create_class_browser_p_sheet (Widget parent); | |
1340 extern Widget create_call_browser_p_sheet (Widget parent); | |
1341 extern Widget create_build_dialog (Widget parent); | |
1342 extern Widget create_editmode_dialog (Widget parent); | |
1343 extern Widget create_search_dialog (Widget parent); | |
1344 extern Widget create_project_display_dialog (Widget parent); | |
1345 | |
1346 static Widget | |
1347 make_one (widget_instance* instance, widget_maker fn) | |
1348 { | |
1349 Widget result; | |
1350 Arg al [64]; | |
1351 int ac = 0; | |
1352 | |
1353 if (instance->pop_up_p) | |
1354 { | |
1355 XtSetArg (al [ac], XmNallowShellResize, TRUE); ac++; | |
1356 result = XmCreateDialogShell (instance->parent, "dialog", NULL, 0); | |
1357 XtAddCallback (result, XmNpopdownCallback, &xm_nosel_callback, | |
1358 (XtPointer) instance); | |
1359 (*fn) (result); | |
1360 } | |
1361 else | |
1362 { | |
1363 result = (*fn) (instance->parent); | |
1364 XtRealizeWidget (result); | |
1365 } | |
1366 return result; | |
1367 } | |
1368 | |
1369 static Widget | |
1370 make_project_p_sheet (widget_instance* instance) | |
1371 { | |
1372 return make_one (instance, create_project_p_sheet); | |
1373 } | |
1374 | |
1375 static Widget | |
1376 make_debugger_p_sheet (widget_instance* instance) | |
1377 { | |
1378 return make_one (instance, create_debugger_p_sheet); | |
1379 } | |
1380 | |
1381 static Widget | |
1382 make_breaklist_p_sheet (widget_instance* instance) | |
1383 { | |
1384 return make_one (instance, create_breaklist_p_sheet); | |
1385 } | |
1386 | |
1387 static Widget | |
1388 make_le_browser_p_sheet (widget_instance* instance) | |
1389 { | |
1390 return make_one (instance, create_le_browser_p_sheet); | |
1391 } | |
1392 | |
1393 static Widget | |
1394 make_class_browser_p_sheet (widget_instance* instance) | |
1395 { | |
1396 return make_one (instance, create_class_browser_p_sheet); | |
1397 } | |
1398 | |
1399 static Widget | |
1400 make_call_browser_p_sheet (widget_instance* instance) | |
1401 { | |
1402 return make_one (instance, create_call_browser_p_sheet); | |
1403 } | |
1404 | |
1405 static Widget | |
1406 make_build_dialog (widget_instance* instance) | |
1407 { | |
1408 return make_one (instance, create_build_dialog); | |
1409 } | |
1410 | |
1411 static Widget | |
1412 make_editmode_dialog (widget_instance* instance) | |
1413 { | |
1414 return make_one (instance, create_editmode_dialog); | |
1415 } | |
1416 | |
1417 static Widget | |
1418 make_search_dialog (widget_instance* instance) | |
1419 { | |
1420 return make_one (instance, create_search_dialog); | |
1421 } | |
1422 | |
1423 static Widget | |
1424 make_project_display_dialog (widget_instance* instance) | |
1425 { | |
1426 return make_one (instance, create_project_display_dialog); | |
1427 } | |
1428 | |
1429 #endif /* ENERGIZE */ | |
1430 | |
1431 widget_creation_entry | |
1432 xm_creation_table [] = | |
1433 { | |
1434 {"menubar", make_menubar}, | |
1435 {"popup", make_popup_menu}, | |
8784 | 1436 {"main", make_main}, |
5626 | 1437 #ifdef ENERGIZE |
1438 {"project_p_sheet", make_project_p_sheet}, | |
1439 {"debugger_p_sheet", make_debugger_p_sheet}, | |
1440 {"breaklist_psheet", make_breaklist_p_sheet}, | |
1441 {"leb_psheet", make_le_browser_p_sheet}, | |
1442 {"class_browser_psheet", make_class_browser_p_sheet}, | |
1443 {"ctree_browser_psheet", make_call_browser_p_sheet}, | |
1444 {"build", make_build_dialog}, | |
1445 {"editmode", make_editmode_dialog}, | |
1446 {"search", make_search_dialog}, | |
1447 {"project_display", make_project_display_dialog}, | |
1448 #endif /* ENERGIZE */ | |
1449 {NULL, NULL} | |
1450 }; | |
1451 | |
1452 /* Destruction of instances */ | |
1453 void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1454 xm_destroy_instance (instance) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1455 widget_instance* instance; |
5626 | 1456 { |
1457 Widget widget = instance->widget; | |
1458 /* recycle the dialog boxes */ | |
1459 /* Disable the recycling until we can find a way to have the dialog box | |
1460 get reasonable layout after we modify its contents. */ | |
1461 if (0 | |
1462 && XtClass (widget) == xmDialogShellWidgetClass) | |
1463 { | |
1464 destroyed_instance* dead_instance = | |
1465 make_destroyed_instance (instance->info->name, | |
1466 instance->info->type, | |
1467 instance->widget, | |
1468 instance->parent, | |
1469 instance->pop_up_p); | |
1470 dead_instance->next = all_destroyed_instances; | |
1471 all_destroyed_instances = dead_instance; | |
1472 XtUnmanageChild (first_child (instance->widget)); | |
1473 XFlush (XtDisplay (instance->widget)); | |
1474 XtAddCallback (instance->parent, XtNdestroyCallback, | |
1475 mark_dead_instance_destroyed, (XtPointer)dead_instance); | |
1476 } | |
1477 else | |
1478 { | |
1479 /* This might not be necessary now that the nosel is attached to | |
1480 popdown instead of destroy, but it can't hurt. */ | |
1481 XtRemoveCallback (instance->widget, XtNdestroyCallback, | |
1482 xm_nosel_callback, (XtPointer)instance); | |
1483 XtDestroyWidget (instance->widget); | |
1484 } | |
1485 } | |
1486 | |
1487 /* popup utility */ | |
1488 void | |
12746
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1489 xm_popup_menu (widget, event) |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1490 Widget widget; |
12746
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1491 XEvent *event; |
5626 | 1492 { |
1493 XButtonPressedEvent dummy; | |
1494 | |
12746
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1495 if (event == 0) |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1496 { |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1497 dummy.type = ButtonPress; |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1498 dummy.serial = 0; |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1499 dummy.send_event = 0; |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1500 dummy.display = XtDisplay (widget); |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1501 dummy.window = XtWindow (XtParent (widget)); |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1502 dummy.time = 0; |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1503 dummy.button = 0; |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1504 XQueryPointer (dummy.display, dummy.window, &dummy.root, |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1505 &dummy.subwindow, &dummy.x_root, &dummy.y_root, |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1506 &dummy.x, &dummy.y, &dummy.state); |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1507 event = (XEvent *) &dummy; |
23cd08c6dd2a
(xm_popup_menu): New arg `event'.
Richard M. Stallman <rms@gnu.org>
parents:
11862
diff
changeset
|
1508 } |
5626 | 1509 |
1510 if (event->type == ButtonPress || event->type == ButtonRelease) | |
1511 { | |
1512 /* This is so totally ridiculous: there's NO WAY to tell Motif | |
1513 that *any* button can select a menu item. Only one button | |
1514 can have that honor. | |
1515 */ | |
1516 char *trans = 0; | |
1517 if (event->xbutton.state & Button5Mask) trans = "<Btn5Down>"; | |
1518 else if (event->xbutton.state & Button4Mask) trans = "<Btn4Down>"; | |
1519 else if (event->xbutton.state & Button3Mask) trans = "<Btn3Down>"; | |
1520 else if (event->xbutton.state & Button2Mask) trans = "<Btn2Down>"; | |
1521 else if (event->xbutton.state & Button1Mask) trans = "<Btn1Down>"; | |
1522 if (trans) XtVaSetValues (widget, XmNmenuPost, trans, 0); | |
1523 XmMenuPosition (widget, (XButtonPressedEvent *) event); | |
1524 } | |
1525 XtManageChild (widget); | |
1526 } | |
1527 | |
1528 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1529 set_min_dialog_size (w) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1530 Widget w; |
5626 | 1531 { |
1532 short width; | |
1533 short height; | |
1534 XtVaGetValues (w, XmNwidth, &width, XmNheight, &height, 0); | |
1535 XtVaSetValues (w, XmNminWidth, width, XmNminHeight, height, 0); | |
1536 } | |
1537 | |
1538 void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1539 xm_pop_instance (instance, up) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1540 widget_instance* instance; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1541 Boolean up; |
5626 | 1542 { |
1543 Widget widget = instance->widget; | |
1544 | |
1545 if (XtClass (widget) == xmDialogShellWidgetClass) | |
1546 { | |
1547 Widget widget_to_manage = first_child (widget); | |
1548 if (up) | |
1549 { | |
1550 XtManageChild (widget_to_manage); | |
1551 set_min_dialog_size (widget); | |
1552 XtSetKeyboardFocus (instance->parent, widget); | |
1553 } | |
1554 else | |
1555 XtUnmanageChild (widget_to_manage); | |
1556 } | |
1557 else | |
1558 { | |
1559 if (up) | |
1560 XtManageChild (widget); | |
1561 else | |
1562 XtUnmanageChild (widget); | |
1563 } | |
1564 } | |
1565 | |
1566 | |
1567 /* motif callback */ | |
1568 | |
1569 enum do_call_type { pre_activate, selection, no_selection, post_activate }; | |
1570 | |
1571 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1572 do_call (widget, closure, type) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1573 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1574 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1575 enum do_call_type type; |
5626 | 1576 { |
1577 Arg al [256]; | |
1578 int ac; | |
1579 XtPointer user_data; | |
1580 widget_instance* instance = (widget_instance*)closure; | |
1581 Widget instance_widget; | |
1582 LWLIB_ID id; | |
1583 | |
1584 if (!instance) | |
1585 return; | |
1586 if (widget->core.being_destroyed) | |
1587 return; | |
1588 | |
1589 instance_widget = instance->widget; | |
1590 if (!instance_widget) | |
1591 return; | |
1592 | |
1593 id = instance->info->id; | |
1594 ac = 0; | |
1595 user_data = NULL; | |
1596 XtSetArg (al [ac], XmNuserData, &user_data); ac++; | |
1597 XtGetValues (widget, al, ac); | |
1598 switch (type) | |
1599 { | |
1600 case pre_activate: | |
1601 if (instance->info->pre_activate_cb) | |
1602 instance->info->pre_activate_cb (widget, id, user_data); | |
1603 break; | |
1604 case selection: | |
1605 if (instance->info->selection_cb) | |
1606 instance->info->selection_cb (widget, id, user_data); | |
1607 break; | |
1608 case no_selection: | |
1609 if (instance->info->selection_cb) | |
1610 instance->info->selection_cb (widget, id, (XtPointer) -1); | |
1611 break; | |
1612 case post_activate: | |
1613 if (instance->info->post_activate_cb) | |
1614 instance->info->post_activate_cb (widget, id, user_data); | |
1615 break; | |
1616 default: | |
1617 abort (); | |
1618 } | |
1619 } | |
1620 | |
1621 /* Like lw_internal_update_other_instances except that it does not do | |
1622 anything if its shell parent is not managed. This is to protect | |
1623 lw_internal_update_other_instances to dereference freed memory | |
1624 if the widget was ``destroyed'' by caching it in the all_destroyed_instances | |
1625 list */ | |
1626 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1627 xm_internal_update_other_instances (widget, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1628 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1629 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1630 XtPointer call_data; |
5626 | 1631 { |
1632 Widget parent; | |
1633 for (parent = widget; parent; parent = XtParent (parent)) | |
1634 if (XtIsShell (parent)) | |
1635 break; | |
1636 else if (!XtIsManaged (parent)) | |
1637 return; | |
1638 lw_internal_update_other_instances (widget, closure, call_data); | |
1639 } | |
1640 | |
1641 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1642 xm_generic_callback (widget, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1643 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1644 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1645 XtPointer call_data; |
5626 | 1646 { |
1647 lw_internal_update_other_instances (widget, closure, call_data); | |
1648 do_call (widget, closure, selection); | |
1649 } | |
1650 | |
1651 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1652 xm_nosel_callback (widget, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1653 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1654 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1655 XtPointer call_data; |
5626 | 1656 { |
1657 /* This callback is only called when a dialog box is dismissed with the wm's | |
1658 destroy button (WM_DELETE_WINDOW.) We want the dialog box to be destroyed | |
1659 in that case, not just unmapped, so that it releases its keyboard grabs. | |
1660 But there are problems with running our callbacks while the widget is in | |
1661 the process of being destroyed, so we set XmNdeleteResponse to XmUNMAP | |
1662 instead of XmDESTROY and then destroy it ourself after having run the | |
1663 callback. | |
1664 */ | |
1665 do_call (widget, closure, no_selection); | |
1666 XtDestroyWidget (widget); | |
1667 } | |
1668 | |
1669 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1670 xm_pull_down_callback (widget, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1671 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1672 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1673 XtPointer call_data; |
5626 | 1674 { |
1675 do_call (widget, closure, pre_activate); | |
1676 } | |
1677 | |
1678 static void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1679 xm_pop_down_callback (widget, closure, call_data) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1680 Widget widget; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1681 XtPointer closure; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1682 XtPointer call_data; |
5626 | 1683 { |
9835
d2250d1b0f48
(make_menu_in_widget): Differentiate a separator entry ("--") from a
Paul Reilly <pmr@pajato.com>
parents:
9825
diff
changeset
|
1684 widget_instance *instance = (widget_instance *) closure; |
d2250d1b0f48
(make_menu_in_widget): Differentiate a separator entry ("--") from a
Paul Reilly <pmr@pajato.com>
parents:
9825
diff
changeset
|
1685 |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1686 if ((!instance->pop_up_p && (XtParent (widget) == instance->widget)) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1687 || (XtParent (widget) == instance->parent)) |
9835
d2250d1b0f48
(make_menu_in_widget): Differentiate a separator entry ("--") from a
Paul Reilly <pmr@pajato.com>
parents:
9825
diff
changeset
|
1688 do_call (widget, closure, post_activate); |
5626 | 1689 } |
1690 | |
1691 | |
1692 /* set the keyboard focus */ | |
1693 void | |
11299
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1694 xm_set_keyboard_focus (parent, w) |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1695 Widget parent; |
f82f4e93e523
(*): remove function prototypes.
Paul Reilly <pmr@pajato.com>
parents:
11245
diff
changeset
|
1696 Widget w; |
5626 | 1697 { |
1698 XmProcessTraversal (w, 0); | |
1699 XtSetKeyboardFocus (parent, w); | |
1700 } | |
9224
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1701 |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1702 /* Motif hack to set the main window areas. */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1703 void |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1704 xm_set_main_areas (parent, menubar, work_area) |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1705 Widget parent; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1706 Widget menubar; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1707 Widget work_area; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1708 { |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1709 XmMainWindowSetAreas (parent, |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1710 menubar, /* menubar (maybe 0) */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1711 0, /* command area (psheets) */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1712 0, /* horizontal scroll */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1713 0, /* vertical scroll */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1714 work_area); /* work area */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1715 } |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1716 |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1717 /* Motif hack to control resizing on the menubar. */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1718 void |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1719 xm_manage_resizing (w, flag) |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1720 Widget w; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1721 Boolean flag; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1722 { |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1723 if (flag) |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1724 { |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1725 /* Enable the edit widget for resizing. */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1726 Arg al[1]; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1727 |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1728 XtSetArg (al[0], XtNallowShellResize, 0); |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1729 XtSetValues (w, al, 1); |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1730 } |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1731 else |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1732 { |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1733 /* Disable the edit widget from resizing. */ |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1734 Arg al[1]; |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1735 |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1736 XtSetArg (al[0], XtNallowShellResize, 0); |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1737 XtSetValues (w, al, 1); |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1738 } |
b4563001d783
(make_menu_in_widget): Add support for displaying a title in pop up
Paul Reilly <pmr@pajato.com>
parents:
8884
diff
changeset
|
1739 } |