Re: Resizing Windows

Havoc Pennington <hp redhat com> writes:

> John Kodis <kodis jagunet com> writes: 
> > I seem to remember seeing code for a GtkAspect widget (I may be
> > mis-remembering the name slightly) written by one of the core Gtk
> > hackers which did exactly what you're asking for.  I don't remember
> > where I saw it though.  Perhaps someone else will have a reference.
> >
> GtkAspectFrame, it's in the devel version of GTK. You could chop it
> out of there.

 a) GtkAspectFrame was the first widget I wrote for GTK+, in early
    1997. So it's definitely in the stable branch as well.

 b) Unfortunately, it doesn't do what Meghal wants (if I understand
    correctly) - maintaining a ratio between the width of two widgets
    - what it does is maintain the width and height of a single

To maintain an aspect ratio between the width of two different widgets
probably is best done by writing a custom container; unfortunately,
that process is not very well documented anywhere, and is a little

It might be possible to manage it by using a GtkFixed widget and
connecting to and overriding ::size_request and ::size_allocate;
this is effectively writing your own container, but with some of
the bookkeeping kept track of for you.


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