GtkTable again



Hello all,

  I'm still fighting with GtkTable and I've come across another problem
(for me *sigh*). I have put here a part of the source (changed, so it
looks a bit uselessly now, but the main idea is the same). 
  The problem is that even that I attach a widget that is to span over 2
or more columns to the table and the rest of widgets are taking only one
column, the wider widget gets shrinked and is made to take up the same
column number as the rest of widgets. 
  I really don't know what to do to make it work.

 ------------------------------------
	<...>
	#define MAX_ENTRY_LEN	10
	<...>

	table = gtk_table_new(3, 3, FALSE);
	<...>
	label = gtk_label_new("label1");
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 5, 0);
	entry = gtk_entry_new_with_max_length(MAX_ENTRY_LEN);
	// i want this entry to span over two columns
	gtk_table_attach(GTK_TABLE(table), entry, 1, 3, 0, 1, GTK_FILL, 0, 0, 0);
						//  ^^^ it's 3 here, but the table ignores it !
	gtk_widget_show(label);
	gtk_widget_show(entry);

	label = gtk_label_new("label2");
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 5, 0);
	entry = gtk_entry_new_with_max_length(MAX_ENTRY_LEN);
	gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
						//  ^^^ 2 here
	gtk_widget_show(label);
        gtk_widget_show(entry);

	label = gtk_label_new("label3");
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 5, 0);
        entry = gtk_entry_new_with_max_length(MAX_ENTRY_LEN);
        gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
                                                //  ^^^ 2 here
        gtk_widget_show(label);
        gtk_widget_show(entry);
	
	<...>
	gtk_widget_show(table);
	<...>
 -------------------------

  Can someone, please, tell me how to make it behave correctly ?

	Thanks a bunch,
			fuf


------------------------------ na IRC -------------------------------------
 BillGates [bgates@www.microsoft.com] has joined #LINUX
 ...
 mode/#linux [+b BillGates!*@*] by DoDad
 BillGates was kicked off #linux by DoDad (banned: We see enough of Bill
          Gates already.)
 




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