gtk-sharp2.10.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.A with an icon. is a which has an icon next to the text label.Note that the user can disable display of menu icons, so make sure to still fill in the text label.
//How to add MenuBar with a Quit stock MenuItem
...
Window win; //if your class derive from Window then call this. istead of win.
MenuBar menuBar
...
AccelGroup grup = new AccelGroup ();
win.AddAccelGroup(grup);
menuFile = new Menu ();
ImageMenuItem quit_item = new ImageMenuItem(Stock.Quit, group);
quit_item.AddAccelerator("activate", grup, new AccelKey(
Gdk.Key.q, Gdk.ModifierType.ControlMask, AccelFlags.Visible));
//OnMenuFileQuit is the Method runned when the event is trigged
quit_item.Activated += new EventHandler (OnMenuFileQuit);
menuFile.Append(quit_item);
MenuItem file_item = new MenuItem("_File");
file_item.Submenu = menuFile;
menuBar.Append(file_item);
Gtk.MenuItemConstructorInternal constructor
Pointer to the C object.
This is an internal constructor, and should not be used by user code.ConstructorCreates a new .ConstructorCreates a new containing the image and text from a stock item.
an object of type
an object of type ConstructorCreates a new containing a label.
an object of type PropertyGtk.WidgetChild widget to appear next to the menu text.an object of type GLib.Property("image")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