[Gtk-sharp-list] Manual layout in GtkSharp

Federico Mena Quintero federico@ximian.com
Tue, 02 Nov 2004 16:43:12 -0600


On Fri, 2004-10-29 at 16:53 -0700, Todd Berman wrote:
> > Agreeing that absolute layout has its problems, I still want to experiment 
> > with it.
> > Miguel seems to say that 'it is not recommended' - implying that it is 
> > possible - can anyone show me how?
> Look at Gtk.Layout.
> 
> Basically you would create a Gtk.Layout and add that to your window,
> then add your button to the layout.

If you really want absolute positioning, use Gtk.Fixed.  It has a simple
Put/Move interface.  To control the size of the child widgets, do use
mywidget.SetSizeRequest().

Gtk.Layout is an artifact from when GTK+ did not support windows with
dimensions larger than 32K pixels.  Now that this is implemented at the
GDK level, there is no reason to use Gtk.Layout anymore.

Absolute positioning is *NOT* recommended, for several reasons:

1. It doesn't work if the user resizes the window --- you have to grow
things like text entries by hand.

2. It doesn't work if the text inside widgets changes.  This includes
localization, where strings can change in length considerably.

3. It doesn't work if you use things like icons and images, whose size
may change.

  Federico