* 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"
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;
}
GtkWidget*
-gtk_vbox_new (gint homogeneous,
+gtk_vbox_new (gboolean homogeneous,
gint spacing)
{
GtkVBox *vbox;
}
else if (nexpand_children > 0)
{
- height = allocation->height - widget->requisition.height;
+ height = (gint)allocation->height - (gint)widget->requisition.height;
extra = height / nexpand_children;
}
else
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)
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
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