Re: Fix columns when resizing...



2011/2/23 Guillaume Brocker <guillaume brocker digital-trainers com>:
> You could perhaps post a minimalist sample code. It may help to understand
> and find a solution.

Here below, a Gtk::Table::attach sequence, added in a Gtk::Dialog,

Gtk::Table::attach (Gtk::Label label1,            0, 1, 0, 1,
Gtk::SHRINK, Gtk::SHRINK, 0, 5);
Gtk::Table::attach (Gtk::Entry entry1,            1, 2, 0, 1,
Gtk::SHRINK, Gtk::SHRINK, 5, 5);
Gtk::Table::attach (Gtk::Entry entry2,            2, 5, 0, 1,
Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 5, 5);

Gtk::Table::attach (Gtk::Label label2,            0, 1, 1, 2,
Gtk::SHRINK, Gtk::SHRINK, 5, 5);
Gtk::Table::attach (Gtk::ScrolledWindow scwindow, 1, 5, 1, 2,
Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 5, 5);

Gtk::Table::attach (Gtk::Label label3,            0, 1, 2, 3,
Gtk::SHRINK, Gtk::SHRINK, 0, 5);
Gtk::Table::attach (Gtk::ComboBoxText cbtext,     1, 5, 2, 3,
Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 5, 5);

Gtk::Table::attach (Gtk::Frame frame,             0, 5, 3, 4,
Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 5);

Gtk::Table::attach (Gtk::Label label4,            0, 1, 4, 5,
Gtk::SHRINK, Gtk::SHRINK, 0, 15);
Gtk::Table::attach (Gtk::Entry entry3,            1, 3, 4, 5,
Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 5, 15);
Gtk::Table::attach (Gtk::Label label5,            3, 4, 4, 5,
Gtk::SHRINK, Gtk::SHRINK, 0, 15);
Gtk::Table::attach (Gtk::SpinButton spbtn,        4, 5, 4, 5,
Gtk::SHRINK, Gtk::SHRINK, 0, 15);

The problem with this comes when this Gtk::Dialog resizes horitzontally.

* <entry1> moves and increases his length... even if a
set_width_chars() method is applied on it.
(I think the column 1-2 increases and <entry1> is just centered on it),

Why ?

Maybe a cause of the Gtk::ScrolledWindow below, inserted at the same column 1-2.

The purpose is that only <entry2> (in this row) should change the size
when Gtk::Dialog resizes.

Glus


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