[Glade-devel] [Glade3] GtkBoxes (eg vbox) not loading properly [PATCH]

Shane Butler shane_b@users.sourceforge.net
Fri, 21 May 2004 10:03:44 +1000


--Boundary_(ID_31CQeiR5gwiMrGnPgQUDcg)
Content-type: text/plain
Content-transfer-encoding: 7BIT

Joaquin,

Sorry I forgot to mention - it looks normal until you resize the window.
Then you will see it is of size = real_size + 3...

Thanks for the info on OptionalDefault, etc.  Maybe a better approach
would be not to set the Default attribute at all, esp. since the dialog
for new vboxes is set to a default of 3 in glade_gtk_box_post_create().
This is what I have done in the patch attached (that and Min=1).

Regards, Shane.

On Fri, 2004-05-21 at 08:03, Joaquin Cuenca Abela wrote:
> Hi Shane,
> 
> Shane wrote:
> > 
> > Hi guys,
> > 
> > Here is a patch to fix a problem in the loading of vboxes, 
> > etc. When loading a .glade file that had a vbox you would get 
> > it would be bigger than it should have been.
> 
> When I load your demo-of-problem.glade, everything seems ok.
> Can you describe in more detail where is the problem?
> 
> > Actually only 
> > gtkbox.xml had to be changed so that the Default size of 3 
> > was an OptionalDefault and the Min size was 1.
> 
> OptionalDefault can only hold true or false (not '3'). It's the initial
> value of the "Optional" attribute, that it's given to a property that should
> have a checkbox to let the user change it or not (as the width and height
> requests of a widget).
> 
> It looks safe to put the Min size to 1 instead of 0, but I would like to
> know exactly what problem are your experiencing before changing anything.
> 
> Thank you for your patch, and sorry for the delay in replying.
> 
> Cheers,
> 
> _______________________________________________
> Glade-devel maillist  -  Glade-devel@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-devel

--Boundary_(ID_31CQeiR5gwiMrGnPgQUDcg)
Content-type: text/xml; name=glade3-vboxbugdemo-resizetosee.glade; charset=UTF-8
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=glade3-vboxbugdemo-resizetosee.glade

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">

<glade-interface>

<widget class="GtkWindow" id="window1">
  <property name="visible">True</property>
  <property name="title" translatable="yes">window1</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_NONE</property>
  <property name="modal">False</property>
  <property name="resizable">True</property>
  <property name="destroy_with_parent">False</property>

  <child>
    <widget class="GtkVBox" id="vbox1">
      <property name="visible">True</property>
      <property name="homogeneous">False</property>
      <property name="spacing">0</property>

      <child>
	<widget class="GtkButton" id="button1">
	  <property name="visible">True</property>
	  <property name="can_focus">True</property>
	  <property name="label" translatable="yes">button1</property>
	  <property name="use_underline">True</property>
	  <property name="relief">GTK_RELIEF_NORMAL</property>
	</widget>
	<packing>
	  <property name="padding">0</property>
	  <property name="expand">False</property>
	  <property name="fill">False</property>
	</packing>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>

--Boundary_(ID_31CQeiR5gwiMrGnPgQUDcg)
Content-type: text/x-patch; name=glade3-vboxpatch2.patch; charset=UTF-8
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=glade3-vboxpatch2.patch

Index: glade3/ChangeLog
===================================================================
RCS file: /cvs/gnome/glade3/ChangeLog,v
retrieving revision 1.293
diff -u -r1.293 ChangeLog
--- a/glade3/ChangeLog	16 May 2004 19:40:04 -0000	1.293
+++ b/glade3/ChangeLog	20 May 2004 23:52:41 -0000
@@ -1,3 +1,7 @@
+2004-05-21  Shane Butler  <shane_b@users.sourceforge.net>
+
+	* widgets/gtkbox.xml: Fixed bug with loading GtkBoxes where too many items were added (resize to see). Removed Default (this is done in glade_gtk_box_post_create() anyway) and set the Min to 1.
+
 2004-05-16  Joaquin Cuenca Abela  <e98cuenc@yahoo.com>
 
 	* src/glade-menu-editor.c, glade-project-window.c, glade-utils.[ch]:
Index: glade3/widgets/gtkbox.xml
===================================================================
RCS file: /cvs/gnome/glade3/widgets/gtkbox.xml,v
retrieving revision 1.9
diff -u -r1.9 gtkbox.xml
--- a/glade3/widgets/gtkbox.xml	1 May 2004 22:05:31 -0000	1.9
+++ b/glade3/widgets/gtkbox.xml	20 May 2004 23:52:41 -0000
@@ -5,11 +5,11 @@
 
   <Properties>
 
-    <Property Id="size" Name="Size" Default="3">
+    <Property Id="size" Name="Size">
       <Type>Integer</Type>
       <Tooltip>The number of items in the box</Tooltip>
       <Parameters>
-        <Parameter Key="Min" Value="0"/>
+        <Parameter Key="Min" Value="1"/>
         <Parameter Key="Max" Value="10000"/>
         <Parameter Key="StepIncrement" Value="1"/>
         <Parameter Key="PageIncrement" Value="10"/>

--Boundary_(ID_31CQeiR5gwiMrGnPgQUDcg)--