[Gtk-sharp-list] Gtk.Label constructors

John Luke jluke@users.sourceforge.net
Wed, 24 Dec 2003 14:56:45 -0500


--=-8EZ/lma+KuidC/rKrWRJ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello,

This patch changes the preferred constructor of Gtk.Label to call
gtk_label_new_with_mnemonic, hides protected Label (), and adds a custom
public Label () to create an empty Label.

Happy Holidays everyone.

--=-8EZ/lma+KuidC/rKrWRJ
Content-Disposition: attachment; filename=label_ctor.diff
Content-Type: text/x-patch; name=label_ctor.diff; charset=
Content-Transfer-Encoding: 7bit

Index: ChangeLog
===================================================================
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.591
diff -u -r1.591 ChangeLog
--- ChangeLog	24 Dec 2003 19:37:41 -0000	1.591
+++ ChangeLog	24 Dec 2003 19:39:51 -0000
@@ -1,3 +1,10 @@
+2003-12-24  John Luke  <jluke@cfl.rr.com>
+
+	* gtk/Label.custom: add public default constructor
+	* gtk/gtk-api.xml:
+	* gtk/Gtk.metadata: make gtk_label_new_with_mnemonic the
+	preferred constructor, disable protected default ctor
+
 2003-12-21  John Luke  <jluke@cfl.rr.com>
 
 	* glib/Idle.cs: add Remove method found in Alp Toker's platano
Index: gtk/Gtk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gtk/Gtk.metadata,v
retrieving revision 1.16
diff -u -r1.16 Gtk.metadata
--- gtk/Gtk.metadata	12 Dec 2003 16:45:50 -0000	1.16
+++ gtk/Gtk.metadata	24 Dec 2003 19:39:51 -0000
@@ -99,7 +99,8 @@
   <attr path="/api/namespace/object[@cname='GtkItem']/signal[@name='Deselect']" name="name">Deselected</attr>
   <attr path="/api/namespace/object[@cname='GtkItem']/signal[@name='Select']" name="name">Selected</attr>
   <attr path="/api/namespace/object[@cname='GtkItem']/signal[@name='Toggle']" name="name">Toggled</attr>
-  <attr path="/api/namespace/object[@cname='GtkLabel']/constructor[@cname='gtk_label_new']" name="preferred">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkLabel']" name="disabledefaultconstructor">1</attr>
+  <attr path="/api/namespace/object[@cname='GtkLabel']/constructor[@cname='gtk_label_new_with_mnemonic']" name="preferred">1</attr>
   <attr path="/api/namespace/object[@cname='GtkLayout']/constructor[@cname='gtk_layout_new']/*/*[@type='GtkAdjustment*']" name="null_ok">1</attr>
   <attr path="/api/namespace/object[@cname='GtkLayout']/method[@name='SetHadjustment']/*/*[@type='GtkAdjustment*']" name="null_ok">1</attr>
   <attr path="/api/namespace/object[@cname='GtkLayout']/method[@name='SetVadjustment']/*/*[@type='GtkAdjustment*']" name="null_ok">1</attr>
Index: gtk/Label.custom
===================================================================
RCS file: gtk/Label.custom
diff -N gtk/Label.custom
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gtk/Label.custom	24 Dec 2003 19:39:51 -0000
@@ -0,0 +1,12 @@
+//
+// Gtk.Label.custom
+//
+// This code is inserted after the automatically generated code.
+//
+//  Author: John Luke  <jluke@cfl.rr.com>
+//
+
+		public Label ()
+		{
+			Raw = gtk_label_new (null);
+		}
Index: gtk/gtk-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/gtk/gtk-api.xml,v
retrieving revision 1.24
diff -u -r1.24 gtk-api.xml
--- gtk/gtk-api.xml	12 Dec 2003 16:45:50 -0000	1.24
+++ gtk/gtk-api.xml	24 Dec 2003 19:39:53 -0000
@@ -4041,7 +4041,7 @@
         </parameters>
       </method>
     </object>
-    <object name="Label" cname="GtkLabel" parent="GtkMisc">
+    <object name="Label" cname="GtkLabel" parent="GtkMisc" disabledefaultconstructor="1">
       <field cname="label" type="gchar*" />
       <field cname="jtype" bits="2" type="guint" />
       <field cname="wrap" bits="1" type="guint" />
@@ -4139,12 +4139,12 @@
       <method name="GetUseUnderline" cname="gtk_label_get_use_underline">
         <return-type type="gboolean" />
       </method>
-      <constructor cname="gtk_label_new" preferred="1">
+      <constructor cname="gtk_label_new">
         <parameters>
           <parameter type="const-char*" name="str" />
         </parameters>
       </constructor>
-      <constructor cname="gtk_label_new_with_mnemonic">
+      <constructor cname="gtk_label_new_with_mnemonic" preferred="1">
         <parameters>
           <parameter type="const-char*" name="str" />
         </parameters>

--=-8EZ/lma+KuidC/rKrWRJ--