From 64d2064d48d49e4f5428dfda13bebb00d63815f6 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 7 May 2009 03:43:45 +0000 Subject: [PATCH] 2009-05-06 Mike Kestner * gtk/RadioMenuItem.custom: implement subclassing for group/label ctor. [Fixes #320971] svn path=/trunk/gtk-sharp/; revision=133706 --- ChangeLog | 5 +++++ gtk/Gtk.metadata | 1 + gtk/RadioMenuItem.custom | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index 30cfac552..f867de3c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-06 Mike Kestner + + * gtk/RadioMenuItem.custom: implement subclassing for group/label + ctor. [Fixes #320971] + 2009-05-06 Mike Kestner * gtk/PaperSize.custom: add static props for Letter and the other diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index 33d330653..d2eab944f 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -561,6 +561,7 @@ 1 1 1 + 1 1 1 1 diff --git a/gtk/RadioMenuItem.custom b/gtk/RadioMenuItem.custom index 324e08527..ea9bbc78d 100644 --- a/gtk/RadioMenuItem.custom +++ b/gtk/RadioMenuItem.custom @@ -36,3 +36,25 @@ Raw = gtk_radio_menu_item_new_with_mnemonic (IntPtr.Zero, label_as_native); GLib.Marshaller.Free (label_as_native); } + + + [DllImport("libgtk-win32-2.0-0.dll")] + static extern IntPtr gtk_radio_menu_item_new_with_mnemonic(IntPtr group, IntPtr label); + + public RadioMenuItem (GLib.SList group, string label) : base (IntPtr.Zero) + { + if (GetType () != typeof (RadioMenuItem)) { + CreateNativeObject (new string [0], new GLib.Value [0]); + AccelLabel al = new AccelLabel (""); + al.TextWithMnemonic = label; + al.SetAlignment (0.0f, 0.5f); + Add (al); + al.AccelWidget = this; + Group = group; + return; + } + IntPtr native_label = GLib.Marshaller.StringToPtrGStrdup (label); + Raw = gtk_radio_menu_item_new_with_mnemonic(group == null ? IntPtr.Zero : group.Handle, native_label); + GLib.Marshaller.Free (native_label); + } +