I am working on a package that I guess would be considered a megawidget
and I vaguely remember reading somewhere that widgets (or was it applications?) that use pack cannot contain widgets that use grid, or
maybe it was the other way around, which means that if my megawidget
uses pack, nobody would be able to use it inside another widget (or
would that be an application?) that already uses grid, or maybe the
other way around, well, you get the idea.
I also vaguely remember reading that "the other way around" was safe
though, that is, one between pack and grid may contain widgets managed
by the other geometry manager.
Is that correct? I can't seem to find that exact information. I guess
I really need to be sure before I make a commitment to either one
(or the other way around).
In addition to what Rich wrote, here is what you *cant* do:**************************
frame .f
label .f.l1
label .f.l2
pack .f.l1
grid .f.l2
error: cannot use geometry manager grid inside .f which already hasslaves managed by pack
grid .f.l2
pack .f.l1
error: cannot use geometry manager pack inside .f which already hasslaves managed by grid
But .f itself can be managed by either grid or pack, regardless of what
you use to pack/grid widgets 'inside' .f
.f itself can be managed by either grid or pack, regardless of what
you use to pack/grid widgets 'inside' .f
On Thu, 16 Jan 2025 11:34:34 +0100, Ralf Fassel wrote:
In addition to what Rich wrote, here is what you *cant* do:**************************
frame .f
label .f.l1
label .f.l2
pack .f.l1
grid .f.l2
error: cannot use geometry manager grid inside .f which already hasslaves managed by pack
grid .f.l2
pack .f.l1
error: cannot use geometry manager pack inside .f which already hasslaves managed by grid
But .f itself can be managed by either grid or pack, regardless of what
you use to pack/grid widgets 'inside' .f
That is my concern.
.f itself can be managed by either grid or pack, regardless of what
you use to pack/grid widgets 'inside' .f
That's because .f is the parent.
Now suppose someone has an application that uses grid. Everything is
inside one big 'gridded' frame. And suppose my megawidget uses pack.
Or the other way around.
That is my concern.
The rule is that any single widget can only be managed by one "manager"
[1] and all the direct children within a widget have to all be managed
by the same manager (because the manager operates from the parent
widget).
[1] "manager" being one of 'pack', 'place', or 'grid'.
Luc <luc@sep.invalid> wrote:Important gotcha: I *think* the OP is comtemplating packing (or gridding) his megawidget. That would be bad practice. The widget (typically a frame)
On Thu, 16 Jan 2025 11:34:34 +0100, Ralf Fassel wrote:
In addition to what Rich wrote, here is what you *cant* do:**************************
frame .f
label .f.l1
label .f.l2
pack .f.l1
grid .f.l2
error: cannot use geometry manager grid inside .f which already hasslaves managed by pack
grid .f.l2
pack .f.l1
error: cannot use geometry manager pack inside .f which already hasslaves managed by grid
But .f itself can be managed by either grid or pack, regardless of what >>you use to pack/grid widgets 'inside' .f
That is my concern.
.f itself can be managed by either grid or pack, regardless of what
you use to pack/grid widgets 'inside' .f
That's because .f is the parent.
Now suppose someone has an application that uses grid. Everything is
inside one big 'gridded' frame. And suppose my megawidget uses pack.
Or the other way around.
That is my concern.
Provided your megawidget exposes only one single top level widget
(usually a frame which holds all the internal widgets) to the user of
the megawidget it will make no difference. The user of the megawidget
can do anything they like to the outer container as far as
pack/grid/placing it, zero impact on your bits and pieces inside that container.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,029 |
Nodes: | 10 (0 / 10) |
Uptime: | 154:34:35 |
Calls: | 13,333 |
Calls today: | 3 |
Files: | 186,574 |
D/L today: |
4,479 files (1,183M bytes) |
Messages: | 3,355,898 |