qulogic/libgnt

Parents 1edda6571c72
Children 7f90c9b222c1
Show the submenu for the toplevel menu without requiring a keypress from the user.
  • +10 -1
    gntwindow.c
  • --- a/gntwindow.c Tue Jan 06 15:34:26 2009 +0000
    +++ b/gntwindow.c Tue Jan 06 16:19:16 2009 +0000
    @@ -49,7 +49,16 @@
    {
    GntWindow *win = GNT_WINDOW(bind);
    if (win->menu) {
    - gnt_screen_menu_show(win->menu);
    + GntMenu *menu = win->menu;
    +
    + gnt_screen_menu_show(menu);
    + if (menu->type == GNT_MENU_TOPLEVEL) {
    + GntMenuItem *item;
    + item = g_list_nth_data(menu->list, menu->selected);
    + if (item && gnt_menuitem_get_submenu(item)) {
    + gnt_widget_activate(GNT_WIDGET(menu));
    + }
    + }
    return TRUE;
    }
    return FALSE;