Size negotiation and initial top-window size



Hi all,

in my app, I need the top-window to have an initial size that suits the content.
It's a bit like in the Gimp, where the image window initial size is set
accordingly to the image size, at a carefully chosen zoom level.

However, this initial size is not mandatory. The user must be able to shrink the
window if he like, there are scrollbars anyway, just like in the Gimp.

The so-called content is in a widget among many other widgets in this window.

Ideally, I would have liked to get the window initial size computed out of the
normal size negotiation of Gtk+. But it seems to be impossible: if I hook to the
size-request event of my content widget, and set the requisition to an
appropriate initial size, then Gtk+ understands this as a mandatory size, and
doesn't let the user shrink the window.

The only solution I found is to play with gtk_window_resize (). It gives quite
good result on X11, but is a bit hackish, and doesn't work very well on Gtk+-Quartz.

Isn't there a way for a widget to say "I would like this size, but I can shrink"
 during the size negotiation process ?

Regards,

-- 
  Olivier Guilyardi / Samalyse



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