Gtk.ImageMenuItem Class
A Gtk.MenuItem with an icon.

See Also: ImageMenuItem Members


public class ImageMenuItem : MenuItem


Gtk.ImageMenuItem is a Gtk.MenuItem 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.

C# Example

	//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 ();

	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);
	MenuItem file_item = new MenuItem("_File");
	file_item.Submenu = menuFile;


Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)
Assembly Versions: