Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Grid widget resize frenzy

5 views
Skip to first unread message

James Bonfield

unread,
Aug 15, 1996, 3:00:00 AM8/15/96
to

I've been trying to update an application that uses extensive amounts of pack,
update, winfo width/height, and reconfigure. The whole assembly builds up to a
mess of packing and flickering whilst the application tries to work out where
things should be (and not always correctly - I'm sure "update" sometimes
returns before X has really sorted things out).

Anyway, this was a prime candidate for the grid widget. However I've ran into
a few problems.

Firstly, the application (a picture of which can be seen, for those who are
interested, at http://www.mrc-lmb.cam.ac.uk/pubseq/manual/gap4_50.html) has a
scrollbar, which when used often changes the height of the window. Using pack
the bottom part of this window (which contains the resizing component)
flickers a lot as scrolling is performed, but otherwise all is stable. Using
the grid widget virtually every visible widget shifts around during the
scrolling motion. Is there a way to stabilise things more?

Secondly, the grid manager often gets completely confused and ends up cycling
between two possible layouts. A simple example of this can be seen with the
following piece of code:

button .b -text test
grid .b
frame .x
pack .x

Is this due to interaction between pack and grid? I was hoping to concoct some
combination of the two to overcome my flickery resize problems mentioned
above.

Any advice is most welcome.

James
--
James Bonfield (j...@mrc-lmb.cam.ac.uk) Tel: 01223 402499 Fax: 01223 412282
Medical Research Council - Laboratory of Molecular Biology,
Hills Road, Cambridge, CB2 2QH, England.
Also see Staden Package WWW site at http://www.mrc-lmb.cam.ac.uk/pubseq/

Marc Graham

unread,
Aug 15, 1996, 3:00:00 AM8/15/96
to James Bonfield

The grid-der is being completely re-written. So, the advice is: wait til
the new one comes out. (Since it'll have it's own set of strange
behaviours.)

I've found that if you use the same frame as a grid and pack master, a
tight cpu loop occurs. Never tried it directly into . though.

John Ousterhout

unread,
Aug 16, 1996, 3:00:00 AM8/16/96
to

Yes, the problem is due to an interaction between pack and grid. The problem
is that each of them is trying to set the desired size for the . window based
on the children that it is managing inside it. They end up fighting, which
causes the infinite loop. The solution is to use "pack propagate" or
whatever the equivalent "grid" command is to make sure that at most one of
them is trying to set .'s requested size.

Donal K. Fellows

unread,
Aug 19, 1996, 3:00:00 AM8/19/96
to

In article <4uur4t$6...@lyra.csx.cam.ac.uk>,

James Bonfield <j...@mrc-lmb.cam.ac.uk> wrote:
> I've been trying to update an application that uses extensive
> amounts of pack, update, winfo width/height, and reconfigure. The
> whole assembly builds up to a mess of packing and flickering whilst
> the application tries to work out where things should be (and not
> always correctly - I'm sure "update" sometimes returns before X has
> really sorted things out).

Withdraw the toplevel (or don't manage the frame) until after
you've done at least one `update idletasks' (which is when the grid
geometry manager actually deals with putting everything together)
and don't try to use any window measurements until you've done your
last piece of manipulation of slaves with grid and an `update
idletasks' afterward.

> Firstly, the application (a picture of which can be seen, for those who are
> interested, at http://www.mrc-lmb.cam.ac.uk/pubseq/manual/gap4_50.html) has
> a scrollbar, which when used often changes the height of the window. Using
> pack the bottom part of this window (which contains the resizing component)
> flickers a lot as scrolling is performed, but otherwise all is stable.
> Using the grid widget virtually every visible widget shifts around during
> the scrolling motion. Is there a way to stabilise things more?

Don't use opaque resizing... :^)

> Secondly, the grid manager often gets completely confused and ends
> up cycling between two possible layouts. A simple example of this
> can be seen with the following piece of code:
>
> button .b -text test
> grid .b
> frame .x
> pack .x
>
> Is this due to interaction between pack and grid? I was hoping to
> concoct some combination of the two to overcome my flickery resize
> problems mentioned above.

Yes. You _can't_ have both grid and pack managing the same window.
However, you could pack a few frames and use the gridder in those
frames...

Donal.
--
Donal K. Fellows, (at work) | Donal K. Fellows, (at home)
Dept. of Computer Science, | 6, Randall Place, Heaton,
University of Manchester | Bradford, BD9 4AE
U.K. Tel: ++44-161-275-6137 | U.K. Tel: ++44-1274-401017
fell...@cs.man.ac.uk (preferred) | do...@ugglan.demon.co.uk (if you must)
--------------------------------------------------------------------------
<http://r8h.cs.man.ac.uk:8000/> for my home page

Donal K. Fellows

unread,
Aug 19, 1996, 3:00:00 AM8/19/96
to

Donal K. Fellows

unread,
Aug 19, 1996, 3:00:00 AM8/19/96
to

Donal K. Fellows

unread,
Aug 19, 1996, 3:00:00 AM8/19/96
to
0 new messages