annotate lwlib/lwlib-Xlw.c @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 0132846995bd
children f220cc83d72e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* The lwlib interface to "xlwmenu" menus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1992, 1994 Lucid, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of the Lucid Widget Library.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 The Lucid Widget Library is free software; you can redistribute it and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 modify it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 The Lucid Widget Library is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
19 Boston, MA 02111-1307, USA. */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 80
diff changeset
21 #include <config.h>
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 #include <stdlib.h> /* for abort () */
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 80
diff changeset
23 #ifdef HAVE_LIMITS_H
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #include <limits.h>
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 80
diff changeset
25 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #include "lwlib-Xlw.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include <X11/StringDefs.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include <X11/IntrinsicP.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include <X11/ObjectP.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include <X11/CompositeP.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include <X11/Shell.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include "xlwmenu.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #ifdef SCROLLBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #include "xlwscrollbar.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 /* Menu callbacks */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 pre_hook (Widget w, XtPointer client_data, XtPointer call_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 widget_instance* instance = (widget_instance*)client_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 widget_value* val;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 if (w->core.being_destroyed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 val = lw_get_widget_value_for_widget (instance, w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 /* #### - this code used to (for some random back_asswards reason) pass
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 the expression below in the call_data slot. For incremental menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 construction, this needs to go. I can't even figure out why it was done
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
60 this way in the first place...it's just a historical weirdism. --Stig */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 call_data = (val ? val->call_data : NULL);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 if (val && val->call_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 abort(); /* #### - the call_data for the top_level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 "menubar" widget_value used to be passed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 back to the pre_hook. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 if (instance->info->pre_activate_cb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 instance->info->pre_activate_cb (w, instance->info->id, call_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 pick_hook (Widget w, XtPointer client_data, XtPointer call_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 widget_instance* instance = (widget_instance*)client_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 widget_value* contents_val = (widget_value*)call_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 widget_value* widget_val;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 XtPointer widget_arg;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 LWLIB_ID id;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 lw_callback post_activate_cb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 if (w->core.being_destroyed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 /* Grab these values before running any functions, in case running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 the selection_cb causes the widget to be destroyed. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 id = instance->info->id;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 post_activate_cb = instance->info->post_activate_cb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 widget_val = lw_get_widget_value_for_widget (instance, w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 widget_arg = widget_val ? widget_val->call_data : NULL;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 if (instance->info->selection_cb &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 contents_val &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 contents_val->enabled &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 !contents_val->contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 instance->info->selection_cb (w, id, contents_val->call_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 if (post_activate_cb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 post_activate_cb (w, id, widget_arg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 /* creation functions */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 static Widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 xlw_create_menubar (widget_instance* instance)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 {
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
109 Arg al [1];
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
110 Widget widget;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
111
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
112 XtSetArg (al [0], XtNmenu, instance->info->val);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
113 widget = XtCreateWidget (instance->info->name, xlwMenuWidgetClass,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
114 instance->parent, al, 1);
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
115 XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 return widget;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 static Widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 xlw_create_popup_menu (widget_instance* instance)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 {
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
123 Arg al [2];
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
124 Widget popup_shell, widget;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
126 popup_shell = XtCreatePopupShell (instance->info->name,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
127 overrideShellWidgetClass,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
128 instance->parent, NULL, 0);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
129 XtSetArg (al [0], XtNmenu, instance->info->val);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
130 XtSetArg (al [1], XtNhorizontal, False);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
131 widget = XtCreateManagedWidget ("popup", xlwMenuWidgetClass,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
132 popup_shell, al, 2);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 return popup_shell;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 #endif /* MENUBARS_LUCID */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 #ifdef SCROLLBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 xlw_scrollbar_callback (Widget widget, XtPointer closure, XtPointer call_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 widget_instance *instance = (widget_instance *) closure;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 LWLIB_ID id;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 XlwScrollBarCallbackStruct *data =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (XlwScrollBarCallbackStruct *) call_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 scroll_event event_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 scrollbar_values *val =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (scrollbar_values *) instance->info->val->scrollbar_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 double percent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 if (!instance || widget->core.being_destroyed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 id = instance->info->id;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 percent = (double) (data->value - 1) / (double) (INT_MAX - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 event_data.slider_value =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (int) (percent * (double) (val->maximum - val->minimum)) + val->minimum;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
161 if (event_data.slider_value > val->maximum - val->slider_size)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
162 event_data.slider_value = val->maximum - val->slider_size;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 else if (event_data.slider_value < val->minimum)
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
164 event_data.slider_value = val->minimum;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 if (data->event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 {
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
168 switch (data->event->type)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 case KeyPress:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 case KeyRelease:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 event_data.time = data->event->xkey.time;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 case ButtonPress:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 case ButtonRelease:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 event_data.time = data->event->xbutton.time;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 case MotionNotify:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 event_data.time = data->event->xmotion.time;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 case EnterNotify:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 case LeaveNotify:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 event_data.time = data->event->xcrossing.time;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 default:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 event_data.time = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 event_data.time = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 switch (data->reason)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 {
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
195 case XmCR_DECREMENT: event_data.action = SCROLLBAR_LINE_UP; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
196 case XmCR_INCREMENT: event_data.action = SCROLLBAR_LINE_DOWN; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
197 case XmCR_PAGE_DECREMENT: event_data.action = SCROLLBAR_PAGE_UP; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
198 case XmCR_PAGE_INCREMENT: event_data.action = SCROLLBAR_PAGE_DOWN; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
199 case XmCR_TO_TOP: event_data.action = SCROLLBAR_TOP; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
200 case XmCR_TO_BOTTOM: event_data.action = SCROLLBAR_BOTTOM; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
201 case XmCR_DRAG: event_data.action = SCROLLBAR_DRAG; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
202 case XmCR_VALUE_CHANGED: event_data.action = SCROLLBAR_CHANGE; break;
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
203 default: event_data.action = SCROLLBAR_CHANGE; break;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 if (instance->info->pre_activate_cb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 instance->info->pre_activate_cb (widget, id, (XtPointer) &event_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
210 #define add_scrollbar_callback(resource) \
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
211 XtAddCallback (scrollbar, resource, xlw_scrollbar_callback, (XtPointer) instance)
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
212
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 /* #### Does not yet support horizontal scrollbars. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 static Widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 xlw_create_scrollbar (widget_instance *instance, int vertical)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 Arg al[20];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 int ac = 0;
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
219 static XtCallbackRec callbacks[2] =
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
220 { {xlw_scrollbar_callback, NULL}, {NULL, NULL} };
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
221
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
222 callbacks[0].closure = (XtPointer) instance;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
224 XtSetArg (al[ac], XmNminimum, 1); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
225 XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
226 XtSetArg (al[ac], XmNincrement, 1); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
227 XtSetArg (al[ac], XmNpageIncrement, 1); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
228 XtSetArg (al[ac], XmNorientation, (vertical ? XmVERTICAL : XmHORIZONTAL)); ac++;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
230 XtSetArg (al[ac], XmNdecrementCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
231 XtSetArg (al[ac], XmNdragCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
232 XtSetArg (al[ac], XmNincrementCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
233 XtSetArg (al[ac], XmNpageDecrementCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
234 XtSetArg (al[ac], XmNpageIncrementCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
235 XtSetArg (al[ac], XmNtoBottomCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
236 XtSetArg (al[ac], XmNtoTopCallback, callbacks); ac++;
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
237 XtSetArg (al[ac], XmNvalueChangedCallback, callbacks); ac++;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
239 return XtCreateWidget (instance->info->name, xlwScrollBarWidgetClass,
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
240 instance->parent, al, ac);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 static Widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 xlw_create_vertical_scrollbar (widget_instance *instance)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 return xlw_create_scrollbar (instance, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 static Widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 xlw_create_horizontal_scrollbar (widget_instance *instance)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 return xlw_create_scrollbar (instance, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 xlw_update_scrollbar (widget_instance *instance, Widget widget,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 widget_value *val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 if (val->scrollbar_data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 scrollbar_values *data = val->scrollbar_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 int widget_sliderSize, widget_val;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 int new_sliderSize, new_value;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 double percent;
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
265 Arg al [4];
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
267 /* First size and position the scrollbar widget. */
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
268 XtSetArg (al [0], XtNx, data->scrollbar_x);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
269 XtSetArg (al [1], XtNy, data->scrollbar_y);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
270 XtSetArg (al [2], XtNwidth, data->scrollbar_width);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
271 XtSetArg (al [3], XtNheight, data->scrollbar_height);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
272 XtSetValues (widget, al, 4);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
274 /* Now size the scrollbar's slider. */
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
275 XtSetArg (al [0], XmNsliderSize, &widget_sliderSize);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
276 XtSetArg (al [1], XmNvalue, &widget_val);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
277 XtGetValues (widget, al, 2);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 percent = (double) data->slider_size /
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (double) (data->maximum - data->minimum);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 percent = (percent > 1.0 ? 1.0 : percent);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 new_sliderSize = (int) ((double) (INT_MAX - 1) * percent);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 percent = (double) (data->slider_position - data->minimum) /
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (double) (data->maximum - data->minimum);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 percent = (percent > 1.0 ? 1.0 : percent);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 new_value = (int) ((double) (INT_MAX - 1) * percent);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 78
diff changeset
289 if (new_sliderSize > INT_MAX - 1)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
290 new_sliderSize = INT_MAX - 1;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
291 else if (new_sliderSize < 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
292 new_sliderSize = 1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 if (new_value > (INT_MAX - new_sliderSize))
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
295 new_value = INT_MAX - new_sliderSize;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 else if (new_value < 1)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
297 new_value = 1;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 if (new_sliderSize != widget_sliderSize || new_value != widget_val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 XlwScrollBarSetValues (widget, new_value, new_sliderSize, 1, 1, False);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 #endif /* SCROLLBARS_LUCID */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 widget_creation_entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 xlw_creation_table [] =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 {"menubar", xlw_create_menubar},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 {"popup", xlw_create_popup_menu},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 #ifdef SCROLLBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 {"vertical-scrollbar", xlw_create_vertical_scrollbar},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 {"horizontal-scrollbar", xlw_create_horizontal_scrollbar},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 {NULL, NULL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 Boolean
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 lw_lucid_widget_p (Widget widget)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 WidgetClass the_class = XtClass (widget);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 if (the_class == xlwMenuWidgetClass)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 return True;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 #ifdef SCROLLBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 if (the_class == xlwScrollBarWidgetClass)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 return True;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 if (the_class == overrideShellWidgetClass)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 XtClass (((CompositeWidget)widget)->composite.children [0])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 == xlwMenuWidgetClass;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 return False;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 xlw_update_one_widget (widget_instance* instance, Widget widget,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 widget_value* val, Boolean deep_p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 WidgetClass class;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 class = XtClass (widget);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 if (0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 else if (class == xlwMenuWidgetClass)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 XlwMenuWidget mw;
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
355 Arg al [1];
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 if (XtIsShell (widget))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 mw = (XlwMenuWidget)widget;
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
360 XtSetArg (al [0], XtNmenu, val);
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents: 163
diff changeset
361 XtSetValues (widget, al, 1);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 #ifdef SCROLLBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 else if (class == xlwScrollBarWidgetClass)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 xlw_update_scrollbar (instance, widget, val);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 xlw_update_one_value (widget_instance* instance, Widget widget,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 widget_value* val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 xlw_pop_instance (widget_instance* instance, Boolean up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 #ifdef MENUBARS_LUCID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 xlw_popup_menu (Widget widget, XEvent *event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 XlwMenuWidget mw;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 if (!XtIsShell (widget))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 if (event->type == ButtonPress || event->type == ButtonRelease)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 xlw_pop_up_menu (mw, (XButtonPressedEvent *)event);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 abort ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 /* Destruction of instances */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 xlw_destroy_instance (widget_instance* instance)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 if (instance->widget)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 XtDestroyWidget (instance->widget);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 }