Requesting enough size, but not too much



I would like my application window to be:
- At least as big as a certain minimum size.
- A little bigger if the screen is big enough for that.
- Not bigger than the screen.
- Not bigger than necessary.

I can control the size of my window by calling these functions on the
individual widgets:
  gtk_widget_set_size_request ()
  gtk_entry_set_width_chars()
but they only let me set a minimum size.

I can also call
  gtk_window_set_default_size()
but I consider that hacky compared to setting child widget sizes, and
it has the same problem anyway. 

Is there no way to specify both a minimum width and natural width (and
height) without deriving custom widgets, to override
GtkWidget::get_preferred_width() ?


I fear that I have to use 
gtk_window_set_geometry_hints(), but that would need me to hard-code
window sizes:
http://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkGeometry

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



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