window sizing with gtk_window_set_usize?



Hi, 

(I'm working with Perl/Gtk on this one, but I'm pretty sure this applies
 to the core Gtk library)

I'd like to have my toplevel application keep track of its size across
invocations, so on exit I get its geometry with:

  $toplevel->allocation;

where $toplevel is my top-level Gtk::Window.  I save this to a file, so
far so good.

However, what's the best to set the initial size of an application's
toplevel window?  At the moment I'm doing:

  # $width & $height come from a file
  $toplevel->set_usize($width, $height);

  # allow grow, allow shrink, no auto-shrink
  $toplevel->set_policy(1, 1, 0);

Which doesn't do quite what I'd like.  Although the initial size is
correct, and the window can be resized, if I shrink it horizontally, it
immediately snaps back to the width as set by set_usize().  The main
child widget is a HPaned which contains to CList widgets.

Is there a way of avoiding this?  I guess what I'd like is to specify a
minimum width & height, and let the user resize the window to any width
& height greater than this minimum, but I haven't been able to find a
way of doing this.

-- 
Des Herriott
des@ops.netcom.net.uk



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