]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkvbox.c
search last visible column instead of using clist->columns.
[~andy/gtk] / gtk / gtkvbox.c
index 585e99b87bb3d05f0a279017f779ca049e5ddbc1..a4b8d031f9719b1e1ea412d0a016109414a7ed77 100644 (file)
@@ -12,8 +12,9 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
  */
 #include "gtkvbox.h"
 
@@ -26,24 +27,26 @@ static void gtk_vbox_size_allocate (GtkWidget      *widget,
                                    GtkAllocation  *allocation);
 
 
-guint
-gtk_vbox_get_type ()
+GtkType
+gtk_vbox_get_type (void)
 {
-  static guint vbox_type = 0;
+  static GtkType vbox_type = 0;
 
   if (!vbox_type)
     {
-      GtkTypeInfo vbox_info =
+      static const GtkTypeInfo vbox_info =
       {
        "GtkVBox",
        sizeof (GtkVBox),
        sizeof (GtkVBoxClass),
        (GtkClassInitFunc) gtk_vbox_class_init,
        (GtkObjectInitFunc) gtk_vbox_init,
-       (GtkArgFunc) NULL,
+       /* reserved_1 */ NULL,
+        /* reserved_2 */ NULL,
+        (GtkClassInitFunc) NULL,
       };
 
-      vbox_type = gtk_type_unique (gtk_box_get_type (), &vbox_info);
+      vbox_type = gtk_type_unique (GTK_TYPE_BOX, &vbox_info);
     }
 
   return vbox_type;
@@ -66,7 +69,7 @@ gtk_vbox_init (GtkVBox *vbox)
 }
 
 GtkWidget*
-gtk_vbox_new (gint homogeneous,
+gtk_vbox_new (gboolean homogeneous,
              gint spacing)
 {
   GtkVBox *vbox;
@@ -186,7 +189,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
        }
       else if (nexpand_children > 0)
        {
-         height = allocation->height - widget->requisition.height;
+         height = (gint)allocation->height - (gint)widget->requisition.height;
          extra = height / nexpand_children;
        }
       else
@@ -197,7 +200,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
       y = allocation->y + GTK_CONTAINER (box)->border_width;
       child_allocation.x = allocation->x + GTK_CONTAINER (box)->border_width;
-      child_allocation.width = allocation->width - GTK_CONTAINER (box)->border_width * 2;
+      child_allocation.width = MAX (1, (gint)allocation->width - (gint)GTK_CONTAINER (box)->border_width * 2);
 
       children = box->children;
       while (children)
@@ -235,7 +238,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
              if (child->fill)
                {
-                 child_allocation.height = child_height - child->padding * 2;
+                 child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
                  child_allocation.y = y + child->padding;
                }
              else
@@ -288,7 +291,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
               if (child->fill)
                 {
-                  child_allocation.height = child_height - child->padding * 2;
+                  child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
                   child_allocation.y = y + child->padding - child_height;
                 }
               else