After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 1261 - Table expansion is a little strange.
Table expansion is a little strange.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
1.2.x
Other other
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 52807 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 1999-05-12 18:30 UTC by Jonathan Blandford
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathan Blandford 2001-01-27 19:46:22 UTC
Package: gtk+
Version: 1.2.2

When creating a table, sometimes space gets allocated incorrectly.  For
example, look at the following sample code:

#include <gtk/gtk.h>

gint
main (gint argc, gchar **argv)
{
	GtkWidget *table, *window, *button1, *button2, *button3;
	
	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_TOPLEVEL);
	table = gtk_table_new (2, 2, FALSE);
	button1 = gtk_button_new_with_label ("Top");
	button2 = gtk_button_new_with_label ("Left");
	button3 = gtk_button_new_with_label ("Right");

	gtk_table_attach (GTK_TABLE (table),
			  button1, 0, 2, 0, 1,
			  GTK_FILL|GTK_EXPAND, 0, 0, 0);
	gtk_widget_set_usize (button1, 300, 20);
	gtk_table_attach (GTK_TABLE (table),
			  button2, 0, 1, 1, 2,
			  0, 0, 0, 0);
	gtk_table_attach (GTK_TABLE (table),
			  button3, 1, 2, 1, 2,
			  GTK_EXPAND, 0, 0, 0);
	gtk_container_add (GTK_CONTAINER (window),
			   table);
	gtk_widget_show_all (window);
	gtk_main ();
}

Button 1 sets the horizontal space that the table uses as it is much
larger then combined width of buttons 2 and 3.  GtkTable then allocates
the extra space evenly between the two buttons.  I think that, as
button3 has an expand flag, and button2 does not, button3 should get all
the space.

-Jonathan




------- Bug moved to this database by debbugs-export@bugzilla.gnome.org 2001-01-27 14:46 -------
This bug was previously known as bug 1261 at http://bugs.gnome.org/
http://bugs.gnome.org/show_bug.cgi?id=1261
Originally filed under the gtk+ product and general component.

Reassigning to the default owner of the component, gtk-bugs@gtk.org.

Comment 1 Owen Taylor 2001-02-01 22:15:16 UTC
Changing this can't be done in 1.2.x since it might break
desired layouts.
Comment 2 Jonathan Blandford 2001-04-02 22:45:28 UTC
*** Bug 52807 has been marked as a duplicate of this bug. ***
Comment 3 Owen Taylor 2002-08-02 21:54:48 UTC
Was fixed prior to 2.0.0.

Sun Mar  3 15:16:07 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtktable.c: When increasing the row or column
        requisitions to make them sufficient for spanning widgets,
        favor rows or columns with expandable children in them.
        (#1261, Jonathan Blandford.)