aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-04-03 17:22:57 +0000
committerRichard M. Stallman1996-04-03 17:22:57 +0000
commitd69fa6b17902c182f3d5ce209453c805a86003ad (patch)
treebd352f15935951a8658986325b4556cb0ebc2df1
parentaa3757b85f2d31eee0c0c40f99d252854e2417cc (diff)
downloademacs-d69fa6b17902c182f3d5ce209453c805a86003ad.tar.gz
emacs-d69fa6b17902c182f3d5ce209453c805a86003ad.zip
(destroy_all_children): When freeing a cascade button, free its submenu too.
(make_menu_in_widget): Use a cascade button gadget, not a widget. Include Xm/CascadeBG.h.
-rw-r--r--lwlib/lwlib-Xm.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 72700641d2d..6d1e76f960e 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
34 34
35#include <Xm/BulletinB.h> 35#include <Xm/BulletinB.h>
36#include <Xm/CascadeB.h> 36#include <Xm/CascadeB.h>
37#include <Xm/CascadeBG.h>
37#include <Xm/DrawingA.h> 38#include <Xm/DrawingA.h>
38#include <Xm/FileSB.h> 39#include <Xm/FileSB.h>
39#include <Xm/Label.h> 40#include <Xm/Label.h>
@@ -168,7 +169,20 @@ destroy_all_children (widget, first_child_to_destroy)
168 /* Unmanage all children and destroy them. They will only be 169 /* Unmanage all children and destroy them. They will only be
169 really destroyed when we get out of DispatchEvent. */ 170 really destroyed when we get out of DispatchEvent. */
170 for (i = first_child_to_destroy; i < number; i++) 171 for (i = first_child_to_destroy; i < number; i++)
171 XtDestroyWidget (children[i]); 172 {
173 Arg al[2];
174 Widget submenu = 0;
175 /* Cascade buttons have submenus,and these submenus
176 need to be freed. But they are not included in
177 XtCompositeChildren. So get it out of the cascade button
178 and free it. If this child is not a cascade button,
179 then submenu should remain unchanged. */
180 XtSetArg (al[0], XmNsubMenuId, &submenu);
181 XtGetValues (children[i], al, 1);
182 if (submenu)
183 XtDestroyWidget (submenu);
184 XtDestroyWidget (children[i]);
185 }
172 186
173 XtFree ((char *) children); 187 XtFree ((char *) children);
174 } 188 }
@@ -427,7 +441,7 @@ make_menu_in_widget (instance, widget, val, keep_first_children)
427 menu = XmCreatePulldownMenu (widget, cur->name, NULL, 0); 441 menu = XmCreatePulldownMenu (widget, cur->name, NULL, 0);
428 make_menu_in_widget (instance, menu, cur->contents, 0); 442 make_menu_in_widget (instance, menu, cur->contents, 0);
429 XtSetArg (al [ac], XmNsubMenuId, menu); ac++; 443 XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
430 button = XmCreateCascadeButton (widget, cur->name, al, ac); 444 button = XmCreateCascadeButtonGadget (widget, cur->name, al, ac);
431 445
432 xm_update_label (instance, button, cur); 446 xm_update_label (instance, button, cur);
433 447