4 Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
6 The Free Software Foundation, Inc.
9 Andrew Borodin <aborodin@vmail.ru>, 2012
11 This file is part of the Midnight Commander.
13 The Midnight Commander is free software: you can redistribute it
14 and/or modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation, either version 3 of the License,
16 or (at your option) any later version.
18 The Midnight Commander is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program. If not, see <http://www.gnu.org/licenses/>.
28 * \brief Source: pulldown menu code
36 #include <sys/types.h>
38 #include "lib/global.h"
40 #include "lib/tty/tty.h"
42 #include "lib/tty/mouse.h"
43 #include "lib/tty/key.h" /* key macros */
44 #include "lib/strutil.h"
45 #include "lib/widget.h"
46 #include "lib/event.h" /* mc_event_raise() */
48 /*** global variables ****************************************************************************/
50 /*** file scope macro definitions ****************************************************************/
52 /*** file scope type declarations ****************************************************************/
54 /*** file scope variables ************************************************************************/
56 /*** file scope functions ************************************************************************/
57 /* --------------------------------------------------------------------------------------------- */
60 menu_arrange (Menu
* menu
, dlg_shortcut_str get_shortcut
)
65 size_t max_shortcut_len
= 0;
67 menu
->max_entry_len
= 1;
68 menu
->max_hotkey_len
= 1;
70 for (i
= menu
->entries
; i
!= NULL
; i
= g_list_next (i
))
72 menu_entry_t
*entry
= i
->data
;
78 len
= (size_t) hotkey_width (entry
->text
);
79 menu
->max_hotkey_len
= max (menu
->max_hotkey_len
, len
);
81 if (get_shortcut
!= NULL
)
82 entry
->shortcut
= get_shortcut (entry
->command
);
84 if (entry
->shortcut
!= NULL
)
86 len
= (size_t) str_term_width1 (entry
->shortcut
);
87 max_shortcut_len
= max (max_shortcut_len
, len
);
92 menu
->max_entry_len
= menu
->max_hotkey_len
+ max_shortcut_len
;
96 /* --------------------------------------------------------------------------------------------- */
99 menubar_paint_idx (WMenuBar
* menubar
, unsigned int idx
, int color
)
101 Widget
*w
= WIDGET (menubar
);
102 const Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
103 const menu_entry_t
*entry
= g_list_nth_data (menu
->entries
, idx
);
104 const int y
= 2 + idx
;
105 int x
= menu
->start_x
;
107 if (x
+ menu
->max_entry_len
+ 4 > (gsize
) w
->cols
)
108 x
= w
->cols
- menu
->max_entry_len
- 4;
113 tty_setcolor (MENU_ENTRY_COLOR
);
115 widget_move (w
, y
, x
- 1);
116 tty_print_alt_char (ACS_LTEE
, FALSE
);
117 tty_draw_hline (w
->y
+ y
, w
->x
+ x
, ACS_HLINE
, menu
->max_entry_len
+ 3);
118 widget_move (w
, y
, x
+ menu
->max_entry_len
+ 3);
119 tty_print_alt_char (ACS_RTEE
, FALSE
);
126 tty_setcolor (color
);
127 widget_move (w
, y
, x
);
128 tty_print_char ((unsigned char) entry
->first_letter
);
129 tty_getyx (&yt
, &xt
);
130 tty_draw_hline (yt
, xt
, ' ', menu
->max_entry_len
+ 2); /* clear line */
131 tty_print_string (entry
->text
.start
);
133 if (entry
->text
.hotkey
!= NULL
)
135 tty_setcolor (color
== MENU_SELECTED_COLOR
? MENU_HOTSEL_COLOR
: MENU_HOT_COLOR
);
136 tty_print_string (entry
->text
.hotkey
);
137 tty_setcolor (color
);
140 if (entry
->text
.end
!= NULL
)
141 tty_print_string (entry
->text
.end
);
143 if (entry
->shortcut
!= NULL
)
145 widget_move (w
, y
, x
+ menu
->max_hotkey_len
+ 3);
146 tty_print_string (entry
->shortcut
);
149 /* move cursor to the start of entry text */
150 widget_move (w
, y
, x
+ 1);
154 /* --------------------------------------------------------------------------------------------- */
157 menubar_draw_drop (WMenuBar
* menubar
)
159 Widget
*w
= WIDGET (menubar
);
160 const Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
161 const unsigned int count
= g_list_length (menu
->entries
);
162 int column
= menu
->start_x
- 1;
165 if (column
+ menu
->max_entry_len
+ 5 > (gsize
) w
->cols
)
166 column
= w
->cols
- menu
->max_entry_len
- 5;
168 tty_setcolor (MENU_ENTRY_COLOR
);
169 draw_box (w
->owner
, w
->y
+ 1, w
->x
+ column
, count
+ 2, menu
->max_entry_len
+ 5, FALSE
);
171 for (i
= 0; i
< count
; i
++)
172 menubar_paint_idx (menubar
, i
,
173 i
== menu
->selected
? MENU_SELECTED_COLOR
: MENU_ENTRY_COLOR
);
176 /* --------------------------------------------------------------------------------------------- */
179 menubar_set_color (WMenuBar
* menubar
, gboolean current
, gboolean hotkey
)
181 if (!menubar
->is_active
)
182 tty_setcolor (MENU_INACTIVE_COLOR
);
184 tty_setcolor (hotkey
? MENU_HOTSEL_COLOR
: MENU_SELECTED_COLOR
);
186 tty_setcolor (hotkey
? MENU_HOT_COLOR
: MENU_ENTRY_COLOR
);
189 /* --------------------------------------------------------------------------------------------- */
192 menubar_draw (WMenuBar
* menubar
)
194 Widget
*w
= WIDGET (menubar
);
197 /* First draw the complete menubar */
198 tty_setcolor (menubar
->is_active
? MENU_ENTRY_COLOR
: MENU_INACTIVE_COLOR
);
199 tty_draw_hline (w
->y
, w
->x
, ' ', w
->cols
);
201 /* Now each one of the entries */
202 for (i
= menubar
->menu
; i
!= NULL
; i
= g_list_next (i
))
204 Menu
*menu
= i
->data
;
205 gboolean is_selected
= (menubar
->selected
== (gsize
) g_list_position (menubar
->menu
, i
));
207 menubar_set_color (menubar
, is_selected
, FALSE
);
208 widget_move (w
, 0, menu
->start_x
);
210 tty_print_char (' ');
211 tty_print_string (menu
->text
.start
);
213 if (menu
->text
.hotkey
!= NULL
)
215 menubar_set_color (menubar
, is_selected
, TRUE
);
216 tty_print_string (menu
->text
.hotkey
);
217 menubar_set_color (menubar
, is_selected
, FALSE
);
220 if (menu
->text
.end
!= NULL
)
221 tty_print_string (menu
->text
.end
);
223 tty_print_char (' ');
226 if (menubar
->is_dropped
)
227 menubar_draw_drop (menubar
);
230 ((Menu
*) g_list_nth_data (menubar
->menu
, menubar
->selected
))->start_x
);
233 /* --------------------------------------------------------------------------------------------- */
236 menubar_remove (WMenuBar
* menubar
)
240 if (!menubar
->is_dropped
)
243 /* HACK: before refresh the dialog, change the current widget to keep the order
244 of overlapped widgets. This is useful in multi-window editor.
245 In general, menubar should be a special object, not an ordinary widget
246 in the current dialog. */
247 h
= WIDGET (menubar
)->owner
;
248 h
->current
= g_list_find (h
->widgets
, dlg_find_by_id (h
, menubar
->previous_widget
));
250 menubar
->is_dropped
= FALSE
;
252 menubar
->is_dropped
= TRUE
;
254 /* restore current widget */
255 h
->current
= g_list_find (h
->widgets
, menubar
);
258 /* --------------------------------------------------------------------------------------------- */
261 menubar_left (WMenuBar
* menubar
)
263 menubar_remove (menubar
);
264 if (menubar
->selected
== 0)
265 menubar
->selected
= g_list_length (menubar
->menu
) - 1;
268 menubar_draw (menubar
);
271 /* --------------------------------------------------------------------------------------------- */
274 menubar_right (WMenuBar
* menubar
)
276 menubar_remove (menubar
);
277 menubar
->selected
= (menubar
->selected
+ 1) % g_list_length (menubar
->menu
);
278 menubar_draw (menubar
);
281 /* --------------------------------------------------------------------------------------------- */
284 menubar_finish (WMenuBar
* menubar
)
286 Widget
*w
= WIDGET (menubar
);
288 menubar
->is_dropped
= FALSE
;
289 menubar
->is_active
= FALSE
;
291 widget_want_hotkey (w
, 0);
293 dlg_select_by_id (w
->owner
, menubar
->previous_widget
);
297 /* --------------------------------------------------------------------------------------------- */
300 menubar_drop (WMenuBar
* menubar
, unsigned int selected
)
302 menubar
->is_dropped
= TRUE
;
303 menubar
->selected
= selected
;
304 menubar_draw (menubar
);
307 /* --------------------------------------------------------------------------------------------- */
310 menubar_execute (WMenuBar
* menubar
)
312 const Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
313 const menu_entry_t
*entry
= g_list_nth_data (menu
->entries
, menu
->selected
);
315 if ((entry
!= NULL
) && (entry
->command
!= CK_IgnoreKey
))
317 Widget
*w
= WIDGET (menubar
);
319 mc_global
.widget
.is_right
= (menubar
->selected
!= 0);
320 menubar_finish (menubar
);
321 send_message (w
->owner
, w
, MSG_ACTION
, entry
->command
, NULL
);
326 /* --------------------------------------------------------------------------------------------- */
329 menubar_down (WMenuBar
* menubar
)
331 Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
332 const unsigned int len
= g_list_length (menu
->entries
);
335 menubar_paint_idx (menubar
, menu
->selected
, MENU_ENTRY_COLOR
);
339 menu
->selected
= (menu
->selected
+ 1) % len
;
340 entry
= (menu_entry_t
*) g_list_nth_data (menu
->entries
, menu
->selected
);
342 while ((entry
== NULL
) || (entry
->command
== CK_IgnoreKey
));
344 menubar_paint_idx (menubar
, menu
->selected
, MENU_SELECTED_COLOR
);
347 /* --------------------------------------------------------------------------------------------- */
350 menubar_up (WMenuBar
* menubar
)
352 Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
353 const unsigned int len
= g_list_length (menu
->entries
);
356 menubar_paint_idx (menubar
, menu
->selected
, MENU_ENTRY_COLOR
);
360 if (menu
->selected
== 0)
361 menu
->selected
= len
- 1;
364 entry
= (menu_entry_t
*) g_list_nth_data (menu
->entries
, menu
->selected
);
366 while ((entry
== NULL
) || (entry
->command
== CK_IgnoreKey
));
368 menubar_paint_idx (menubar
, menu
->selected
, MENU_SELECTED_COLOR
);
371 /* --------------------------------------------------------------------------------------------- */
374 menubar_first (WMenuBar
* menubar
)
376 Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
379 if (menu
->selected
== 0)
382 menubar_paint_idx (menubar
, menu
->selected
, MENU_ENTRY_COLOR
);
388 entry
= (menu_entry_t
*) g_list_nth_data (menu
->entries
, menu
->selected
);
390 if ((entry
== NULL
) || (entry
->command
== CK_IgnoreKey
))
396 menubar_paint_idx (menubar
, menu
->selected
, MENU_SELECTED_COLOR
);
399 /* --------------------------------------------------------------------------------------------- */
402 menubar_last (WMenuBar
* menubar
)
404 Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
405 const unsigned int len
= g_list_length (menu
->entries
);
408 if (menu
->selected
== len
- 1)
411 menubar_paint_idx (menubar
, menu
->selected
, MENU_ENTRY_COLOR
);
413 menu
->selected
= len
;
418 entry
= (menu_entry_t
*) g_list_nth_data (menu
->entries
, menu
->selected
);
420 while ((entry
== NULL
) || (entry
->command
== CK_IgnoreKey
));
422 menubar_paint_idx (menubar
, menu
->selected
, MENU_SELECTED_COLOR
);
425 /* --------------------------------------------------------------------------------------------- */
428 menubar_handle_key (WMenuBar
* menubar
, int key
)
432 key
= g_ascii_tolower (key
);
434 if (is_abort_char (key
))
436 menubar_finish (menubar
);
440 /* menubar help or menubar navigation */
445 ev_help_t event_data
= { NULL
, NULL
};
447 if (menubar
->is_dropped
)
449 ((Menu
*) g_list_nth_data (menubar
->menu
, menubar
->selected
))->help_node
;
451 event_data
.node
= "[Menu Bar]";
453 mc_event_raise (MCEVENT_GROUP_CORE
, "help", &event_data
);
454 menubar_draw (menubar
);
459 menubar_left (menubar
);
464 menubar_right (menubar
);
468 if (!menubar
->is_dropped
)
472 /* drop menu by hotkey */
473 for (i
= menubar
->menu
; i
!= NULL
; i
= g_list_next (i
))
475 Menu
*menu
= i
->data
;
477 if ((menu
->text
.hotkey
!= NULL
) && (key
== g_ascii_tolower (menu
->text
.hotkey
[0])))
479 menubar_drop (menubar
, g_list_position (menubar
->menu
, i
));
484 /* drop menu by Enter or Dowwn key */
485 if (key
== KEY_ENTER
|| key
== XCTRL ('n') || key
== KEY_DOWN
|| key
== '\n')
486 menubar_drop (menubar
, menubar
->selected
);
492 Menu
*menu
= g_list_nth_data (menubar
->menu
, menubar
->selected
);
495 /* execute menu command by hotkey */
496 for (i
= menu
->entries
; i
!= NULL
; i
= g_list_next (i
))
498 const menu_entry_t
*entry
= i
->data
;
500 if ((entry
!= NULL
) && (entry
->command
!= CK_IgnoreKey
)
501 && (entry
->text
.hotkey
!= NULL
) && (key
== g_ascii_tolower (entry
->text
.hotkey
[0])))
503 menu
->selected
= g_list_position (menu
->entries
, i
);
504 menubar_execute (menubar
);
509 /* menu execute by Enter or menu navigation */
514 menubar_execute (menubar
);
519 menubar_first (menubar
);
524 menubar_last (menubar
);
529 menubar_down (menubar
);
534 menubar_up (menubar
);
542 /* --------------------------------------------------------------------------------------------- */
545 menubar_callback (Widget
* w
, Widget
* sender
, widget_msg_t msg
, int parm
, void *data
)
547 WMenuBar
*menubar
= MENUBAR (w
);
551 /* We do not want the focus unless we have been activated */
553 if (!menubar
->is_active
)
554 return MSG_NOT_HANDLED
;
556 /* Trick to get all the mouse events */
559 /* Trick to get all of the hotkeys */
560 widget_want_hotkey (w
, 1);
561 menubar_draw (menubar
);
564 /* We don't want the buttonbar to activate while using the menubar */
567 if (menubar
->is_active
)
569 menubar_handle_key (menubar
, parm
);
572 return MSG_NOT_HANDLED
;
575 /* Put the cursor in a suitable place */
576 return MSG_NOT_HANDLED
;
579 return menubar
->is_active
? MSG_NOT_HANDLED
: MSG_HANDLED
;
582 if (menubar
->is_visible
)
584 menubar_draw (menubar
);
590 /* try show menu after screen resize */
591 send_message (w
, sender
, MSG_FOCUS
, 0, data
);
596 menubar_set_menu (menubar
, NULL
);
600 return widget_default_callback (w
, sender
, msg
, parm
, data
);
604 /* --------------------------------------------------------------------------------------------- */
607 menubar_event (Gpm_Event
* event
, void *data
)
609 WMenuBar
*menubar
= MENUBAR (data
);
610 Widget
*w
= WIDGET (data
);
611 gboolean was_active
= TRUE
;
612 int left_x
, right_x
, bottom_y
;
616 if (!mouse_global_in_widget (event
, w
))
617 return MOU_UNHANDLED
;
619 /* ignore unsupported events */
620 if ((event
->type
& (GPM_UP
| GPM_DOWN
| GPM_DRAG
)) == 0)
623 /* ignore wheel events if menu is inactive */
624 if (!menubar
->is_active
&& ((event
->buttons
& (GPM_B_MIDDLE
| GPM_B_UP
| GPM_B_DOWN
)) != 0))
627 local
= mouse_get_local (event
, w
);
629 if (local
.y
== 1 && (local
.type
& GPM_UP
) != 0)
632 if (!menubar
->is_dropped
)
634 menubar
->previous_widget
= dlg_get_current_widget_id (w
->owner
);
635 menubar
->is_active
= TRUE
;
636 menubar
->is_dropped
= TRUE
;
640 /* Mouse operations on the menubar */
641 if (local
.y
== 1 || !was_active
)
643 /* wheel events on menubar */
644 if ((local
.buttons
& GPM_B_UP
) != 0)
645 menubar_left (menubar
);
646 else if ((local
.buttons
& GPM_B_DOWN
) != 0)
647 menubar_right (menubar
);
650 const unsigned int len
= g_list_length (menubar
->menu
);
651 unsigned int new_selection
= 0;
653 while ((new_selection
< len
)
654 && (local
.x
> ((Menu
*) g_list_nth_data (menubar
->menu
,
655 new_selection
))->start_x
))
658 if (new_selection
!= 0) /* Don't set the invalid value -1 */
663 menubar
->selected
= new_selection
;
664 dlg_select_widget (menubar
);
668 menubar_remove (menubar
);
669 menubar
->selected
= new_selection
;
671 menubar_draw (menubar
);
676 if (!menubar
->is_dropped
|| (local
.y
< 2))
679 /* middle click -- everywhere */
680 if (((local
.buttons
& GPM_B_MIDDLE
) != 0) && ((local
.type
& GPM_DOWN
) != 0))
682 menubar_execute (menubar
);
686 /* the mouse operation is on the menus or it is not */
687 menu
= (Menu
*) g_list_nth_data (menubar
->menu
, menubar
->selected
);
688 left_x
= menu
->start_x
;
689 right_x
= left_x
+ menu
->max_entry_len
+ 3;
690 if (right_x
> w
->cols
)
692 left_x
= w
->cols
- menu
->max_entry_len
- 3;
696 bottom_y
= g_list_length (menu
->entries
) + 3;
698 if ((local
.x
>= left_x
) && (local
.x
<= right_x
) && (local
.y
<= bottom_y
))
700 int pos
= local
.y
- 3;
701 const menu_entry_t
*entry
= g_list_nth_data (menu
->entries
, pos
);
704 if ((local
.buttons
& GPM_B_UP
) != 0 && (local
.type
& GPM_DOWN
) != 0)
706 menubar_up (menubar
);
709 if ((local
.buttons
& GPM_B_DOWN
) != 0 && (local
.type
& GPM_DOWN
) != 0)
711 menubar_down (menubar
);
715 /* ignore events above and below dropped down menu */
716 if ((pos
< 0) || (pos
>= bottom_y
- 3))
719 if ((entry
!= NULL
) && (entry
->command
!= CK_IgnoreKey
))
721 menubar_paint_idx (menubar
, menu
->selected
, MENU_ENTRY_COLOR
);
722 menu
->selected
= pos
;
723 menubar_paint_idx (menubar
, menu
->selected
, MENU_SELECTED_COLOR
);
725 if ((event
->type
& GPM_UP
) != 0)
726 menubar_execute (menubar
);
729 else if (((local
.type
& GPM_DOWN
) != 0) && ((local
.buttons
& (GPM_B_UP
| GPM_B_DOWN
)) == 0))
731 /* use click not wheel to close menu */
732 menubar_finish (menubar
);
738 /* --------------------------------------------------------------------------------------------- */
739 /*** public functions ****************************************************************************/
740 /* --------------------------------------------------------------------------------------------- */
743 menu_entry_create (const char *name
, unsigned long command
)
747 entry
= g_new (menu_entry_t
, 1);
748 entry
->first_letter
= ' ';
749 entry
->text
= parse_hotkey (name
);
750 entry
->command
= command
;
751 entry
->shortcut
= NULL
;
756 /* --------------------------------------------------------------------------------------------- */
759 menu_entry_free (menu_entry_t
* entry
)
763 release_hotkey (entry
->text
);
764 g_free (entry
->shortcut
);
769 /* --------------------------------------------------------------------------------------------- */
772 create_menu (const char *name
, GList
* entries
, const char *help_node
)
776 menu
= g_new (Menu
, 1);
778 menu
->text
= parse_hotkey (name
);
779 menu
->entries
= entries
;
780 menu
->max_entry_len
= 1;
781 menu
->max_hotkey_len
= 0;
783 menu
->help_node
= g_strdup (help_node
);
788 /* --------------------------------------------------------------------------------------------- */
791 menu_set_name (Menu
* menu
, const char *name
)
793 release_hotkey (menu
->text
);
794 menu
->text
= parse_hotkey (name
);
797 /* --------------------------------------------------------------------------------------------- */
800 destroy_menu (Menu
* menu
)
802 release_hotkey (menu
->text
);
803 g_list_foreach (menu
->entries
, (GFunc
) menu_entry_free
, NULL
);
804 g_list_free (menu
->entries
);
805 g_free (menu
->help_node
);
809 /* --------------------------------------------------------------------------------------------- */
812 menubar_new (int y
, int x
, int cols
, GList
* menu
)
817 menubar
= g_new0 (WMenuBar
, 1);
818 w
= WIDGET (menubar
);
819 init_widget (w
, y
, x
, 1, cols
, menubar_callback
, menubar_event
);
821 menubar
->is_visible
= TRUE
; /* by default */
822 widget_want_cursor (w
, FALSE
);
823 menubar_set_menu (menubar
, menu
);
828 /* --------------------------------------------------------------------------------------------- */
831 menubar_set_menu (WMenuBar
* menubar
, GList
* menu
)
833 /* delete previous menu */
834 if (menubar
->menu
!= NULL
)
836 g_list_foreach (menubar
->menu
, (GFunc
) destroy_menu
, NULL
);
837 g_list_free (menubar
->menu
);
840 menubar
->is_active
= FALSE
;
841 menubar
->is_dropped
= FALSE
;
842 menubar
->menu
= menu
;
843 menubar
->selected
= 0;
844 menubar_arrange (menubar
);
847 /* --------------------------------------------------------------------------------------------- */
850 menubar_add_menu (WMenuBar
* menubar
, Menu
* menu
)
854 menu_arrange (menu
, WIDGET (menubar
)->owner
->get_shortcut
);
855 menubar
->menu
= g_list_append (menubar
->menu
, menu
);
858 menubar_arrange (menubar
);
861 /* --------------------------------------------------------------------------------------------- */
863 * Properly space menubar items. Should be called when menubar is created
864 * and also when widget width is changed (i.e. upon xterm resize).
868 menubar_arrange (WMenuBar
* menubar
)
874 if (menubar
->menu
== NULL
)
877 gap
= WIDGET (menubar
)->cols
- 2;
879 /* First, calculate gap between items... */
880 for (i
= menubar
->menu
; i
!= NULL
; i
= g_list_next (i
))
882 Menu
*menu
= (Menu
*) i
->data
;
883 /* preserve length here, to be used below */
884 menu
->start_x
= hotkey_width (menu
->text
) + 2;
885 gap
-= menu
->start_x
;
888 if (g_list_next (menubar
->menu
) == NULL
)
891 gap
/= (g_list_length (menubar
->menu
) - 1);
895 /* We are out of luck - window is too narrow... */
901 /* ...and now fix start positions of menubar items */
902 for (i
= menubar
->menu
; i
!= NULL
; i
= g_list_next (i
))
904 Menu
*menu
= (Menu
*) i
->data
;
905 int len
= menu
->start_x
;
907 menu
->start_x
= start_x
;
908 start_x
+= len
+ gap
;
912 /* --------------------------------------------------------------------------------------------- */
913 /** Find MenuBar widget in the dialog */
916 find_menubar (const WDialog
* h
)
918 return MENUBAR (find_widget_type (h
, menubar_callback
));
921 /* --------------------------------------------------------------------------------------------- */