diff options
| author | Richard M. Stallman | 1994-02-19 20:53:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-02-19 20:53:26 +0000 |
| commit | 364e6904f33db6725c8ae0fa3853e7b9c3b5b218 (patch) | |
| tree | f0f0c801a4073f68d0a024aa15ea3c59327861bb | |
| parent | ffab2bd62ccd45c33060f48788b52be32b5f158b (diff) | |
| download | emacs-364e6904f33db6725c8ae0fa3853e7b9c3b5b218.tar.gz emacs-364e6904f33db6725c8ae0fa3853e7b9c3b5b218.zip | |
*** empty log message ***
| -rw-r--r-- | lwlib/Makefile.in | 4 | ||||
| -rw-r--r-- | lwlib/lwlib-Xlw.c | 47 |
2 files changed, 30 insertions, 21 deletions
diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index ac6b875273a..5690838f52b 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in | |||
| @@ -54,10 +54,10 @@ liblw.a: $(OBJS) | |||
| 54 | #That's ok. So don't stop the build. | 54 | #That's ok. So don't stop the build. |
| 55 | 55 | ||
| 56 | lwlib.o: lwlib.c | 56 | lwlib.o: lwlib.c |
| 57 | $(CC) -c $(ALL_CFLAGS) $(TOOLKIT_DEFINES) $(srcdir)/lwlib.c | 57 | $(CC) -c $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c |
| 58 | 58 | ||
| 59 | xrdb-cpp.o: xrdb-cpp.c | 59 | xrdb-cpp.o: xrdb-cpp.c |
| 60 | $(CC) -c $(ALL_CFLAGS) "-DCPP_PROGRAM=$(CPP)" $(srcdir)/xrdb-cpp.c | 60 | $(CC) -c "-DCPP_PROGRAM=$(CPP)" $(ALL_CFLAGS) $(srcdir)/xrdb-cpp.c |
| 61 | 61 | ||
| 62 | lwlib-utils.o: lwlib-utils.h | 62 | lwlib-utils.o: lwlib-utils.h |
| 63 | lwlib.o: lwlib.h lwlib-int.h | 63 | lwlib.o: lwlib.h lwlib-int.h |
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c index e07ee19c7bf..4b48b231a4d 100644 --- a/lwlib/lwlib-Xlw.c +++ b/lwlib/lwlib-Xlw.c | |||
| @@ -78,19 +78,24 @@ xlw_create_menubar (instance) | |||
| 78 | { | 78 | { |
| 79 | Widget widget; | 79 | Widget widget; |
| 80 | 80 | ||
| 81 | widget_value *tem = malloc_widget_value (); | 81 | /* Don't use malloc_widget_value, because the freeing will be done by free. |
| 82 | (Also it wastes time calling memset). */ | ||
| 83 | widget_value *tem = (widget_value *) malloc (sizeof (widget_value)); | ||
| 82 | 84 | ||
| 83 | /* _XtCreate is freeing the object we passed, | 85 | /* _XtCreate is freeing the object we passed, |
| 84 | so make a copy that we free later. */ | 86 | so make a copy that we free later. */ |
| 85 | bcopy (instance->info->val, tem, sizeof (widget_value)); | 87 | bcopy (instance->info->val, tem, sizeof (widget_value)); |
| 86 | 88 | ||
| 87 | widget = | 89 | widget |
| 88 | XtVaCreateWidget (instance->info->name, xlwMenuWidgetClass, | 90 | = XtVaCreateWidget (instance->info->name, xlwMenuWidgetClass, |
| 89 | instance->parent, | 91 | instance->parent, |
| 90 | XtNmenu, tem, | 92 | XtNmenu, tem, |
| 91 | 0); | 93 | 0); |
| 92 | 94 | ||
| 95 | #if 0 /* XtVaCreateWidget frees this, at least in the X11R4 | ||
| 96 | version that is running on mole.gnu.ai.mit.edu. */ | ||
| 93 | free_widget_value (tem); | 97 | free_widget_value (tem); |
| 98 | #endif | ||
| 94 | 99 | ||
| 95 | XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); | 100 | XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); |
| 96 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); | 101 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); |
| @@ -101,26 +106,30 @@ static Widget | |||
| 101 | xlw_create_popup_menu (instance) | 106 | xlw_create_popup_menu (instance) |
| 102 | widget_instance* instance; | 107 | widget_instance* instance; |
| 103 | { | 108 | { |
| 104 | Widget popup_shell = | 109 | Widget popup_shell |
| 105 | XtCreatePopupShell (instance->info->name, overrideShellWidgetClass, | 110 | = XtCreatePopupShell (instance->info->name, overrideShellWidgetClass, |
| 106 | instance->parent, NULL, 0); | 111 | instance->parent, NULL, 0); |
| 107 | 112 | ||
| 108 | Widget widget; | 113 | Widget widget; |
| 109 | 114 | ||
| 110 | widget_value *tem = malloc_widget_value (); | 115 | /* Don't use malloc_widget_value, because the freeing will be done by free. |
| 116 | (Also it wastes time calling memset). */ | ||
| 117 | widget_value *tem = (widget_value *) malloc (sizeof (widget_value)); | ||
| 111 | 118 | ||
| 112 | /* _XtCreate is freeing the object we passed, | 119 | /* _XtCreate is freeing the object we passed, |
| 113 | so make a copy that we free later. */ | 120 | so make a copy that we free later. */ |
| 114 | bcopy (instance->info->val, tem, sizeof (widget_value)); | 121 | bcopy (instance->info->val, tem, sizeof (widget_value)); |
| 115 | 122 | ||
| 116 | widget = | 123 | widget |
| 117 | XtVaCreateManagedWidget ("popup", xlwMenuWidgetClass, | 124 | = XtVaCreateManagedWidget ("popup", xlwMenuWidgetClass, |
| 118 | popup_shell, | 125 | popup_shell, |
| 119 | XtNmenu, tem, | 126 | XtNmenu, tem, |
| 120 | XtNhorizontal, False, | 127 | XtNhorizontal, False, |
| 121 | 0); | 128 | 0); |
| 122 | 129 | ||
| 130 | #if 0 | ||
| 123 | free_widget_value (tem); | 131 | free_widget_value (tem); |
| 132 | #endif | ||
| 124 | 133 | ||
| 125 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); | 134 | XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); |
| 126 | 135 | ||
| @@ -140,12 +149,12 @@ lw_lucid_widget_p (widget) | |||
| 140 | Widget widget; | 149 | Widget widget; |
| 141 | { | 150 | { |
| 142 | WidgetClass the_class = XtClass (widget); | 151 | WidgetClass the_class = XtClass (widget); |
| 152 | |||
| 143 | if (the_class == xlwMenuWidgetClass) | 153 | if (the_class == xlwMenuWidgetClass) |
| 144 | return True; | 154 | return True; |
| 145 | if (the_class == overrideShellWidgetClass) | 155 | if (the_class == overrideShellWidgetClass) |
| 146 | return | 156 | return (XtClass (((CompositeWidget)widget)->composite.children [0]) |
| 147 | XtClass (((CompositeWidget)widget)->composite.children [0]) | 157 | == xlwMenuWidgetClass); |
| 148 | == xlwMenuWidgetClass; | ||
| 149 | return False; | 158 | return False; |
| 150 | } | 159 | } |
| 151 | 160 | ||