[Gtk-sharp-list] RadioButton api

John Luke jluke@users.sourceforge.net
Thu, 08 Jan 2004 18:26:51 -0500


--=-wHQjCTu1xHKl9gUuTyYB
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Wed, 2004-01-07 at 21:50 -0500, John Luke wrote:
> On Wed, 2004-01-07 at 15:42 -0600, Mike Kestner wrote:
> > On Wed, 2004-01-07 at 15:31, Mike Kestner wrote:
> > 
> > > Please add that and commit.  Thanks.
> > 
> > Third and hopefully final post.  Is there any reason to expose a Group
> > property any more without a GSList ctor?  Should we also hide the
> > get_group and set_group properties?
> > -- 
> I think there may be a need to know which group a radiobutton is in, but
> I think we need to hide the GList and GSList stuff.  I'll work on it
> tomorrow and send an updated patch.

After thinking through this some more, I think it is ok to hide the
group property and methods.  If it proves that we need access to a group
property, we can add one that gets/sets the group as a RadioButton, but
I think it wont be necessary.

Attached updated patch.

--=-wHQjCTu1xHKl9gUuTyYB
Content-Disposition: attachment; filename=radiobutton.diff
Content-Type: text/x-patch; name=radiobutton.diff; charset=UTF-8
Content-Transfer-Encoding: 7bit

? button.diff
? dialog.diff
? gdk_key.diff
? radiobutton.diff
? test.diff
? widget_gtkaccelkey.diff
Index: Gtk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gtk/Gtk.metadata,v
retrieving revision 1.21
diff -u -r1.21 Gtk.metadata
--- Gtk.metadata	8 Jan 2004 21:57:30 -0000	1.21
+++ Gtk.metadata	8 Jan 2004 23:04:07 -0000
@@ -135,10 +135,14 @@
   <attr path="/api/namespace/object[@cname='GtkPixmap']/method[@name='Set']/*/*[@type='GdkBitmap*']" name="null_ok">1</attr>
   <attr path="/api/namespace/object[@cname='GtkProgressBar']/constructor[@cname='gtk_progress_bar_new_with_adjustment']/*/*[@type='GtkAdjustment*']" name="null_ok">1</attr>
   <attr path="/api/namespace/object[@cname='GtkProgressBar']" name="parent">GtkWidget</attr>
-  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new']/*/*[@type='GSList*']" name="null_ok">1</attr>
-  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_label']/*/*[@type='GSList*']" name="null_ok">1</attr>
-  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_mnemonic']" name="preferred">1</attr>
-  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_mnemonic']/*/*[@type='GSList*']" name="null_ok">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/method[@name='GetGroup']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/method[@name='SetGroup']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_label_from_widget']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_mnemonic_from_widget']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_label']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_mnemonic']" name="hidden">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkRadioButton']/constructor[@cname='gtk_radio_button_new_with_mnemonic']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GtkRadioButton']/property[@name='Group']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GtkRadioMenuItem']/constructor[@cname='gtk_radio_menu_item_new_with_label']/*/*[@type='GSList*']" name="null_ok">1</attr>
   <attr path="/api/namespace/object[@cname='GtkRadioMenuItem']/constructor[@cname='gtk_radio_menu_item_new_with_mnemonic']" name="preferred">1</attr>
Index: RadioButton.custom
===================================================================
RCS file: RadioButton.custom
diff -N RadioButton.custom
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ RadioButton.custom	8 Jan 2004 23:04:07 -0000
@@ -0,0 +1,22 @@
+//
+//  RadioButton.custom
+//
+//	Author:  John Luke  <jluke@cfl.rr.com>
+//
+
+	[DllImport("libgtk-win32-2.0-0.dll")]
+	static extern IntPtr gtk_radio_button_new_with_mnemonic (IntPtr group, string label);
+
+	// creates a new group for this RadioButton
+	public RadioButton (string label)
+	{
+		Raw = gtk_radio_button_new_with_mnemonic (IntPtr.Zero, label);
+	}
+	
+	[DllImport("libgtk-win32-2.0-0.dll")]
+	static extern IntPtr gtk_radio_button_new_with_mnemonic_from_widget (IntPtr group, string label);
+	
+	public RadioButton (RadioButton group, string label)
+	{
+		Raw = gtk_radio_button_new_with_mnemonic_from_widget (group.Handle, label);
+	}
Index: gtk-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/gtk/gtk-api.xml,v
retrieving revision 1.29
diff -u -r1.29 gtk-api.xml
--- gtk-api.xml	8 Jan 2004 21:57:30 -0000	1.29
+++ gtk-api.xml	8 Jan 2004 23:04:09 -0000
@@ -5405,13 +5405,13 @@
     <object name="RadioButton" cname="GtkRadioButton" parent="GtkCheckButton">
       <field cname="group" type="GSList*" />
       <property name="Group" cname="group" type="GtkRadioButton" writeable="true" hidden="1" />
-      <method name="GetGroup" cname="gtk_radio_button_get_group">
+      <method name="GetGroup" cname="gtk_radio_button_get_group" hidden="1">
         <return-type type="GSList*" />
       </method>
       <method name="GetType" cname="gtk_radio_button_get_type" shared="true">
         <return-type type="GType" />
       </method>
-      <constructor cname="gtk_radio_button_new">
+      <constructor cname="gtk_radio_button_new" hidden="1">
         <parameters>
           <parameter type="GSList*" name="group" null_ok="1" />
         </parameters>
@@ -5421,31 +5421,31 @@
           <parameter type="GtkRadioButton*" name="group" />
         </parameters>
       </constructor>
-      <constructor cname="gtk_radio_button_new_with_label">
+      <constructor cname="gtk_radio_button_new_with_label" hidden="1">
         <parameters>
           <parameter type="GSList*" name="group" null_ok="1" />
           <parameter type="const-gchar*" name="label" />
         </parameters>
       </constructor>
-      <constructor cname="gtk_radio_button_new_with_label_from_widget">
+      <constructor cname="gtk_radio_button_new_with_label_from_widget" hidden="1">
         <parameters>
           <parameter type="GtkRadioButton*" name="group" />
           <parameter type="const-gchar*" name="label" />
         </parameters>
       </constructor>
-      <constructor cname="gtk_radio_button_new_with_mnemonic" preferred="1">
+      <constructor cname="gtk_radio_button_new_with_mnemonic" preferred="1" hidden="1">
         <parameters>
           <parameter type="GSList*" name="group" null_ok="1" />
           <parameter type="const-gchar*" name="label" />
         </parameters>
       </constructor>
-      <constructor cname="gtk_radio_button_new_with_mnemonic_from_widget">
+      <constructor cname="gtk_radio_button_new_with_mnemonic_from_widget" hidden="1">
         <parameters>
           <parameter type="GtkRadioButton*" name="group" />
           <parameter type="const-gchar*" name="label" />
         </parameters>
       </constructor>
-      <method name="SetGroup" cname="gtk_radio_button_set_group">
+      <method name="SetGroup" cname="gtk_radio_button_set_group" hidden="1">
         <return-type type="void" />
         <parameters>
           <parameter type="GSList*" name="group" />

--=-wHQjCTu1xHKl9gUuTyYB--