fixed size widgets in a Gtk::Table



I have a table, and in one row of the table, I want to have several fixed sized widgets (all but one), and one that would fill up the space available. it would look something like this:

+-------------------------------------------------------------+
|+- fixed1 -+ +-- fill up ---------+ +- fixed2 -+ +- fixed3 -+|
+-------------------------------------------------------------+


I tried to achieve this by calling set_size_request() on the widgets, something like:

fixed1->set_size_request(30, 100);
fillUp->set_size_request(-1, 100);
fixed2->set_size_request(40, 100);
fixed3->set_size_requesr(20, 100);

and then attaching the above to my table in the following manner:

table->attach(*fixed1, 0, 1, 0, 1,
              Gtk::FILL|Gtk::SHRINK, Gtk::FILL|Gtk::SHRINK);
table->attach(*fillUp, 1, 2, 0, 1,
              Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::SHRINK);
table->attach(*fixed2, 2, 3, 0, 1,
              Gtk::FILL|Gtk::SHRINK, Gtk::FILL|Gtk::SHRINK);
table->attach(*fixed3, 3, 4, 0, 1,
              Gtk::FILL|Gtk::SHRINK, Gtk::FILL|Gtk::SHRINK);


after this I would expect fixed1, fixed2 and fixed3 to become the sizes I specified at set_size_request(), and fullUp to occupy the remaining space.

The unfortunate reality is that fixed1, for some reason, gets smaller then what is specified at set_size_request(). what am I doing wrong?


Akos



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