gtk-sharp2.10.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.The MenuBar is a subclass of MenuShell which contains one to many MenuItem.
The result is a standard menu bar which can hold many menu items. allows for a shadow type to be set for aesthetic purposes.
using System;
using Gtk;
public class MenuApp {
public static void Main (string[] args)
{
new MenuApp();
}
public MenuApp(){
Application.Init();
Window win = new Window ("Menu Sample App");
MenuBar mb = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem exit_item = new MenuItem("Exit");
exit_item.Activated += new EventHandler (on_exit_item_activate);
file_menu.Append (exit_item);
MenuItem file_item = new MenuItem("File");
file_item.Submenu = file_menu;
mb.Append (file_item);
win.Add (mb);
win.ShowAll ();
Application.Run ();
}
public void on_exit_item_activate(object o, EventArgs args)
{
Application.Quit ();
}
Gtk.MenuShellConstructorInternal constructor
Pointer to the C object.
This is an internal constructor, and should not be used by user code.ConstructorA constructor.PropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected Constructor.
a Chain to this constructor if you have manually registered a native value for your subclass.System.Obsolete(Message=null, IsError=False)PropertyGLib.Property(Name="pack-direction")Gtk.PackDirectionPacking direction.a .Indicates how menu items are layed out on the menu bar.PropertyGLib.Property(Name="child-pack-direction")Gtk.PackDirectionChild packing direction.a .Indicates how child menu items are layed out on the menu bar's submenus.