indexing description: "Eiffel Vision menu bar. GTK+ implementation." status: "See notice at end of class" date: "$Date$" revision: "$Revision$" class EV_MENU_BAR_IMP inherit EV_MENU_BAR_I redefine interface end EV_MENU_ITEM_LIST_IMP redefine interface, insert_menu_item end create make feature {NONE} -- Initialization needs_event_box: BOOLEAN is False make (an_interface: like interface) is do base_make (an_interface) set_c_object (feature {EV_GTK_EXTERNALS}.gtk_menu_bar_new) initialize_menu_bar_style (c_object) feature {EV_GTK_EXTERNALS}.gtk_widget_show (c_object) end initialize_menu_bar_style (a_menu_bar: POINTER) is -- Remove the default shadow from the menubar external "C inline use " alias "[ { gtk_widget_set_name ((GtkWidget*) $a_menu_bar, "v2menubar"); gtk_rc_parse_string ("style \"v2-menubar-style\" {\n GtkMenuBar::shadow-type = none\n }\n widget \"*.v2menubar\" style : highest \"v2-menubar-style\" " ); } ]" end feature {EV_WINDOW_IMP} -- Implementation set_parent_window_imp (a_wind: EV_WINDOW_IMP) is -- Set `parent_window' to `a_wind'. require a_wind_not_void: a_wind /= Void do parent_imp := a_wind end parent: EV_WINDOW is -- Parent window of Current. do if parent_imp /= Void then Result := parent_imp.interface end end remove_parent_window is -- Set `parent_window' to Void. do parent_imp := Void end parent_imp: EV_WINDOW_IMP feature {NONE} -- Implementation insert_menu_item (an_item_imp: EV_MENU_ITEM_IMP; pos: INTEGER) is -- Generic menu item insertion. do an_item_imp.set_item_parent_imp (Current) feature {EV_GTK_EXTERNALS}.gtk_menu_shell_insert (list_widget, an_item_imp.c_object, pos - 1) child_array.go_i_th (pos) child_array.put_left (an_item_imp.interface) end feature {EV_ANY_I} -- Implementation interface: EV_MENU_BAR end -- class EV_MENU_BAR_IMP --|---------------------------------------------------------------- --| EiffelVision2: library of reusable components for ISE Eiffel. --| Copyright (C) 1985-2004 Eiffel Software. All rights reserved. --| Duplication and distribution prohibited. May be used only with --| ISE Eiffel, under terms of user license. --| Contact Eiffel Software for any other use. --| --| Interactive Software Engineering Inc. --| dba Eiffel Software --| 356 Storke Road, Goleta, CA 93117 USA --| Telephone 805-685-1006, Fax 805-685-6869 --| Contact us at: http://www.eiffel.com/general/email.html --| Customer support: http://support.eiffel.com --| For latest info on our award winning products, visit: --| http://www.eiffel.com --|----------------------------------------------------------------