Re: how to limit the size of a window?



WEBER Luc <luc weber obs unige ch> writes:

I'm trying to limit the size of a window containing a drawing area at
the maximum size of this drawing area. I want to accept a smaller window
but I want to limit the size in both axes if the user try to make a
window larger.

Use gtk_window_set_geometry_hints(). The 2.0 docs on this should be
enough to figure it out. (Though 2.0 is slightly different.)

Set the drawing area as geometry widget, then set the max and min size
of the drawing area in your GdkGeometryHints struct.

I do that in a configure_event with a gtk_widget_set_usize().

That queues a size request/allocation cycle from the allocation
portion of a previous cycle, thus a big mess.

Havoc



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