Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
11917:2314b62ca4ab | 11918:da016ba65a6c |
---|---|
1537 /* Disable resizing (done for Motif!) */ | 1537 /* Disable resizing (done for Motif!) */ |
1538 lw_allow_resizing (f->display.x->widget, False); | 1538 lw_allow_resizing (f->display.x->widget, False); |
1539 | 1539 |
1540 /* The third arg is DEEP_P, which says to consider the entire | 1540 /* The third arg is DEEP_P, which says to consider the entire |
1541 menu trees we supply, rather than just the menu bar item names. */ | 1541 menu trees we supply, rather than just the menu bar item names. */ |
1542 lw_modify_all_widgets (id, first_wv, 1); | 1542 lw_modify_all_widgets ((LWLIB_ID) id, first_wv, 1); |
1543 | 1543 |
1544 /* Re-enable the edit widget to resize. */ | 1544 /* Re-enable the edit widget to resize. */ |
1545 lw_allow_resizing (f->display.x->widget, True); | 1545 lw_allow_resizing (f->display.x->widget, True); |
1546 } | 1546 } |
1547 else | 1547 else |
1548 { | 1548 { |
1549 menubar_widget = lw_create_widget ("menubar", "menubar", | 1549 menubar_widget = lw_create_widget ("menubar", "menubar", |
1550 id, first_wv, | 1550 (LWLIB_ID) id, first_wv, |
1551 f->display.x->column_widget, | 1551 f->display.x->column_widget, |
1552 0, | 1552 0, |
1553 popup_activate_callback, | 1553 popup_activate_callback, |
1554 menubar_selection_callback, | 1554 menubar_selection_callback, |
1555 popup_deactivate_callback); | 1555 popup_deactivate_callback); |
1612 | 1612 |
1613 if (menubar_widget) | 1613 if (menubar_widget) |
1614 { | 1614 { |
1615 id = frame_vector_add_frame (f); | 1615 id = frame_vector_add_frame (f); |
1616 BLOCK_INPUT; | 1616 BLOCK_INPUT; |
1617 lw_destroy_all_widgets (id); | 1617 lw_destroy_all_widgets ((LWLIB_ID) id); |
1618 XVECTOR (frame_vector)->contents[id] = Qnil; | 1618 XVECTOR (frame_vector)->contents[id] = Qnil; |
1619 UNBLOCK_INPUT; | 1619 UNBLOCK_INPUT; |
1620 } | 1620 } |
1621 } | 1621 } |
1622 | 1622 |
1639 (We return nil on failure, but the value doesn't actually matter.) */ | 1639 (We return nil on failure, but the value doesn't actually matter.) */ |
1640 | 1640 |
1641 #ifdef USE_X_TOOLKIT | 1641 #ifdef USE_X_TOOLKIT |
1642 | 1642 |
1643 /* We need a unique id for each widget handled by the Lucid Widget | 1643 /* We need a unique id for each widget handled by the Lucid Widget |
1644 library. This includes the frame main windows, popup menu and | 1644 library. |
1645 dialog box. */ | 1645 |
1646 For the main windows, and popup menus, we use this counter, | |
1647 which we increment each time after use. | |
1648 | |
1649 For menu bars, we use the index of the frame in frame_vector | |
1650 as the id. */ | |
1646 LWLIB_ID widget_id_tick; | 1651 LWLIB_ID widget_id_tick; |
1647 | 1652 |
1648 #ifdef __STDC__ | 1653 #ifdef __STDC__ |
1649 static Lisp_Object *volatile menu_item_selection; | 1654 static Lisp_Object *volatile menu_item_selection; |
1650 #else | 1655 #else |
1669 int keymaps; | 1674 int keymaps; |
1670 Lisp_Object title; | 1675 Lisp_Object title; |
1671 char **error; | 1676 char **error; |
1672 { | 1677 { |
1673 int i; | 1678 int i; |
1674 int menu_id; | 1679 LWLIB_ID menu_id; |
1675 Widget menu; | 1680 Widget menu; |
1676 Arg av [2]; | 1681 Arg av [2]; |
1677 int ac = 0; | 1682 int ac = 0; |
1678 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; | 1683 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; |
1679 widget_value **submenu_stack | 1684 widget_value **submenu_stack |
1819 wv_title->next = wv_sep1; | 1824 wv_title->next = wv_sep1; |
1820 first_wv->contents = wv_title; | 1825 first_wv->contents = wv_title; |
1821 } | 1826 } |
1822 | 1827 |
1823 /* Actually create the menu. */ | 1828 /* Actually create the menu. */ |
1824 menu_id = ++widget_id_tick; | 1829 menu_id = widget_id_tick++; |
1825 menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv, | 1830 menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv, |
1826 f->display.x->widget, 1, 0, | 1831 f->display.x->widget, 1, 0, |
1827 popup_selection_callback, | 1832 popup_selection_callback, |
1828 popup_deactivate_callback); | 1833 popup_deactivate_callback); |
1829 | 1834 |
1932 int keymaps; | 1937 int keymaps; |
1933 Lisp_Object title; | 1938 Lisp_Object title; |
1934 char **error; | 1939 char **error; |
1935 { | 1940 { |
1936 int i, nb_buttons=0; | 1941 int i, nb_buttons=0; |
1937 int dialog_id; | 1942 LWLIB_ID dialog_id; |
1938 Widget menu; | 1943 Widget menu; |
1939 char dialog_name[6]; | 1944 char dialog_name[6]; |
1940 | 1945 |
1941 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; | 1946 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; |
1942 | 1947 |
2042 wv->contents = first_wv; | 2047 wv->contents = first_wv; |
2043 first_wv = wv; | 2048 first_wv = wv; |
2044 } | 2049 } |
2045 | 2050 |
2046 /* Actually create the dialog. */ | 2051 /* Actually create the dialog. */ |
2047 dialog_id = ++widget_id_tick; | 2052 dialog_id = widget_id_tick++; |
2048 menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, | 2053 menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, |
2049 f->display.x->widget, 1, 0, | 2054 f->display.x->widget, 1, 0, |
2050 dialog_selection_callback, 0); | 2055 dialog_selection_callback, 0); |
2051 lw_modify_all_widgets (dialog_id, first_wv->contents, True); | 2056 lw_modify_all_widgets (dialog_id, first_wv->contents, True); |
2052 /* Free the widget_value objects we used to specify the contents. */ | 2057 /* Free the widget_value objects we used to specify the contents. */ |