[Gtk-sharp-list] Gtk ImageMenuItem class customizations

Moritz Balz verteiler@mbalz.de
Sun, 07 Mar 2004 17:18:44 +0100


This is a multi-part message in MIME format.
--------------060306090509020904020407
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I propose to add two constructor overloads to Gtk.ImageMenuItem (see
.custom file attached).
They allow to specify an image when the ImageMenuItem is created.

M.

--------------060306090509020904020407
Content-Type: text/plain;
 name="ImageMenuItem.custom"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ImageMenuItem.custom"

// Gtk.ImageMenuItem.custom - Gtk ImageMenuItem class customizations
//
// Author: Moritz Balz <ich@mbalz.de>
//
// (c) 2004 Moritz Balz
//
// This code is inserted after the automatically generated code.

		[DllImport("libgtk-win32-2.0-0.dll")]
		static extern IntPtr gtk_image_new_from_stock (string stock_id, int size);

		public ImageMenuItem (string stockId, string label) : base (label)
		{
			gtk_image_menu_item_set_image (Handle, gtk_image_new_from_stock (stockId, (int)Gtk.IconSize.Menu));
		}

		public ImageMenuItem (Gtk.Image image, string label) : base (label)
		{
			gtk_image_menu_item_set_image (Handle, image.Handle);
		}

--------------060306090509020904020407--