Re: Requesting enough size, but not too much




Enviado desde mi iPhone

El 10/02/2012, a las 10:38, Murray Cumming <murrayc murrayc com> escribió:

> 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

 Yeah but you do not need to hardcode a window size instead you could get the screen size and hardcode a percentage which I think it would be almost acceptable :)

> -- 
> Murray Cumming
> murrayc murrayc com
> www.murrayc.com
> www.openismus.com
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list


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