Re: [gtkmm] pack_start and AttachOptions is still confusing
- From: Michael Babcock <mbabcock la creatureshop henson com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] pack_start and AttachOptions is still confusing
- Date: Mon, 15 Jul 2002 11:22:03 -0700
Marcelo E. Magallon wrote:
Murray Cumming <murrayc usa net> writes:
> Are you certain that (false, true) is never used? Can you convince me
> or show me something official that says that?
Ok. I found a place where (false, true) can be used.
Picture the following table:
+-----+-----+-----+
| 0,0 | 1,0 | 2,0 |
+-----+-----+-----+
| 0,1 | 1,1 | 2,1 |
+-----+-----+-----+
| 0,2 | 1,2 | 2,2 |
+-----+-----+-----+
In GTK+, when you attach a widget to a table you specify three
parameters (expand, fill and shrink) for both x and y.
Let's say (1,0) has only expand set in x and (1,1) has only fill set in
x. The result is that (1,0) expands the whole column and (1,1) has
more space to fill. I don't claim this makes sense, I'm only saying
it's possible.
After thinking about it, the example I mentioned previously now makes
sense: a horizontal separator without "fill" set has null size. But
you don't want to set expand on it because you want it to be as large
as the largest element in the group, not larger.
Do you mean 0 horizontal size? A separator without "fill" is Gtk::SHRINK
and it wouldn't make sense to set that horizontally for a hseparator
because as you say the size would shrink to zero. By group, you mean
column, right?
Now *my* question is what does shrink mean? Why aren't expand and fill
enough for a table? The documentation really doesn't help here.
Yes, with a Table you have the additional factor of the column width, so
you can be allocated more space than expected with a Box. So Gtk::SHRINK
is equivalent to Gtk::EXPAND if another row has a wider column!
I guess I'm basically agreeing with you, just trying to understand the
issue better. The problem here _seems_ to be an overloading of the
EXPAND term. In the case of a Table, it both indicates to fill extra
allocated column space with padding, _and_ possibly to expand the amount
allocated to that widget within the row, which in turn would increase
the column size.
So, for x-options:
Gtk::SHRINK expands the column to at least the widget's size request. If
the column is wider, fill extra space with padding.
Gtk::EXPAND expands the cell based on the other cells in the row. Set
the colunn width to the maximum of the cell width and existing column
width, fill extra space with padding.
Gtk::EXPAND|Gtk::FILL as above, but fills space by increasing widget size.
So Gtk::FILL alone would be like Gtk::EXPAND|Gtk::FILL except it would
not increase the column width? It does seem to be different than
Gtk::SHRINK, right?
--
Michael Babcock
Jim Henson's Creature Shop
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]