Fwd: Requesting enough size, but not too much



forgot to CC the list:

Begin forwarded message:

From: tristan van berkom gmail com
Date: 12 February, 2012 9:29:37 PM GMT+09:00
To: Murray Cumming <murrayc murrayc com>
Subject: Re: Requesting enough size, but not too much


On 2012-02-10, at 10:38 PM, Murray Cumming <murrayc murrayc com> wrote:

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.

gtk_widget_set_natural_size() was a desirable API which
we did not land by 3.0 but I think it would be a very welcome
addition (havoc also suggested that one).

I've also noticed that current 3.x behavior is to
have the windows's default size be derived from
the natural size request automatically.

I'm not sure if the default size also automatically
maxes out at the screen size... but I think essentially
we're just missing the API to manually force the natural
request of a given widget.

Sry for quick short reply from hand held device...


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

_______________________________________________
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]