[Glade-devel] [glade3] GtkNotebook PATCH



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

Hi all,

Please find attached a patch to fix a few GtkNotebook bits and pieces.
Firstly it hooks up the post create function for the GtkNotebook widget,
so you now get a dialog asking how many pages the notebook should have.
Secondly it blocks the fill empty function (this was creating notebooks
of size+1). Finally I set the minimum size of the GtkBox and GtkNotebook
dialogs to be 1.

Could someone please review and commit if it is ok?!

Cheers, Shane

--=-ufYRTfavO0mJV6glkSK9
Content-Disposition: attachment; filename=glade3-gtknotebook.patch
Content-Type: text/x-patch; name=glade3-gtknotebook.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

Index: glade3/ChangeLog
===================================================================
RCS file: /cvs/gnome/glade3/ChangeLog,v
retrieving revision 1.299
diff -u -r1.299 ChangeLog
--- glade3/ChangeLog    26 Jul 2004 10:37:23 -0000      1.299
+++ glade3/ChangeLog    29 Aug 2004 12:53:30 -0000
@@ -1,3 +1,11 @@
+2004-07-29  Shane Butler  <shane_b users sourceforge net>
+
+       * src/glade-gtk.c (glade_gtk_notebook_post_create, 
+       glade_gtk_box_post_create): Fix notebook size query and make both
+       GktBox and GtkNotebook ask for size > 1.
+       * widgets/gtknotebook.xml: Link the post create function and do 
+       not fill empty (has the effect of adding an extra tab).
+
 2004-07-26  Shane Butler  <shane_b users sourceforge net>
 
        * widgets/gtkbox.xml: Fixed bug with loading GtkBoxes where too
Index: glade3/src/glade-gtk.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-gtk.c,v
retrieving revision 1.48
diff -u -r1.48 glade-gtk.c
--- glade3/src/glade-gtk.c      8 May 2004 20:01:30 -0000       1.48
+++ glade3/src/glade-gtk.c      29 Aug 2004 12:53:35 -0000
@@ -663,7 +663,7 @@
        GValue value = {0,};
 
        g_value_init (&value, G_TYPE_INT);
-       g_value_set_int (&value, ask_for_number(_("Create a box"), _("Number of items:"), 0, 10000, 3));
+       g_value_set_int (&value, ask_for_number(_("Create a box"), _("Number of items:"), 1, 10000, 3));
 
        glade_property_set (property, &value);
 }
@@ -671,11 +671,13 @@
 void GLADEGTK_API
 glade_gtk_notebook_post_create (GObject *object)
 {
-       GladeProperty *property = glade_widget_get_property (glade_widget_get_from_gtk_widget (object), 
"size");
+       GladeProperty *property = glade_widget_get_property (glade_widget_get_from_gtk_widget (object), 
"pages");
        GValue value = {0,};
 
        g_value_init (&value, G_TYPE_INT);
-       g_value_set_int (&value, ask_for_number(_("Create a notebook"), _("Number of pages:"), 0, 100, 3));
+       g_value_set_int (&value, ask_for_number(_("Create a notebook"), _("Number of pages:"), 1, 100, 3));
+
+       glade_property_set (property, &value);
 }
 
 void GLADEGTK_API
Index: glade3/widgets/gtknotebook.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtknotebook.xml,v
retrieving revision 1.11
diff -u -r1.11 gtknotebook.xml
--- glade3/widgets/gtknotebook.xml      20 Oct 2003 18:16:34 -0000      1.11
+++ glade3/widgets/gtknotebook.xml      29 Aug 2004 12:53:37 -0000
@@ -1,6 +1,8 @@
 <GladeWidgetClass>
 
+  <PostCreateFunction>glade_gtk_notebook_post_create</PostCreateFunction>
   <ReplaceChildFunction>glade_gtk_notebook_replace_child</ReplaceChildFunction>
+  <FillEmptyFunction>ignore</FillEmptyFunction>
 
   <Properties>
 
@@ -12,7 +14,7 @@
         <Parameter Key="Max" Value="100"/>
         <Parameter Key="StepIncrement" Value="1"/>
         <Parameter Key="PageIncrement" Value="1"/>
-        <Parameter Key="ClibmRate" Value="1"/>
+        <Parameter Key="ClimbRate" Value="1"/>
       </Parameters>
       <Query>
         <Question>Number of pages</Question>

--=-ufYRTfavO0mJV6glkSK9--





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]