diff src/xmenu.c @ 11918:da016ba65a6c

(xmenu_show, xdialog_show): Increment widget_id_tick in the same was as in xfns.c. Use LWLIB_ID type where appropriate. (set_frame_menubar, free_frame_menubar): Add casts to LWLIB_ID.
author Karl Heuer <kwzh@gnu.org>
date Thu, 25 May 1995 16:01:12 +0000
parents 0f03ad1cac1e
children 4117d74ba254
line wrap: on
line diff
--- a/src/xmenu.c	Thu May 25 16:00:51 1995 +0000
+++ b/src/xmenu.c	Thu May 25 16:01:12 1995 +0000
@@ -1539,7 +1539,7 @@
 
       /* The third arg is DEEP_P, which says to consider the entire
 	 menu trees we supply, rather than just the menu bar item names.  */
-      lw_modify_all_widgets (id, first_wv, 1);
+      lw_modify_all_widgets ((LWLIB_ID) id, first_wv, 1);
 
       /* Re-enable the edit widget to resize.  */
       lw_allow_resizing (f->display.x->widget, True);
@@ -1547,7 +1547,7 @@
   else
     {
       menubar_widget = lw_create_widget ("menubar", "menubar", 
-					 id, first_wv, 
+					 (LWLIB_ID) id, first_wv, 
 					 f->display.x->column_widget,
 					 0,
 					 popup_activate_callback,
@@ -1614,7 +1614,7 @@
     {
       id = frame_vector_add_frame (f);
       BLOCK_INPUT;
-      lw_destroy_all_widgets (id);
+      lw_destroy_all_widgets ((LWLIB_ID) id);
       XVECTOR (frame_vector)->contents[id] = Qnil;
       UNBLOCK_INPUT;
     }
@@ -1641,8 +1641,13 @@
 #ifdef USE_X_TOOLKIT
 
 /* We need a unique id for each widget handled by the Lucid Widget
-   library.  This includes the frame main windows, popup menu and
-   dialog box.  */
+   library.
+
+   For the main windows, and popup menus, we use this counter,
+   which we increment each time after use.
+
+   For menu bars, we use the index of the frame in frame_vector
+   as the id.  */
 LWLIB_ID widget_id_tick;
 
 #ifdef __STDC__
@@ -1671,7 +1676,7 @@
      char **error;
 {
   int i;
-  int menu_id;
+  LWLIB_ID menu_id;
   Widget menu;
   Arg av [2];
   int ac = 0;
@@ -1821,7 +1826,7 @@
     }
 
   /* Actually create the menu.  */
-  menu_id = ++widget_id_tick;
+  menu_id = widget_id_tick++;
   menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv,
 			   f->display.x->widget, 1, 0,
 			   popup_selection_callback,
@@ -1934,7 +1939,7 @@
      char **error;
 {
   int i, nb_buttons=0;
-  int dialog_id;
+  LWLIB_ID dialog_id;
   Widget menu;
   char dialog_name[6];
 
@@ -2044,7 +2049,7 @@
   }
 
   /* Actually create the dialog.  */
-  dialog_id = ++widget_id_tick;
+  dialog_id = widget_id_tick++;
   menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
 			   f->display.x->widget, 1, 0,
 			   dialog_selection_callback, 0);