python - How to force window to keep a specific ratio in GTK+? -
i have gtkwindow
i'd resizable, but constrained in ratio proportions. easiest way accomplish that? should manually resize on each configure-event
, or there easier way it?
my widget hierarchy looks that:
gtkwindow gtkbox gtktoolbar gtkbox gtkaspectframe
from answers got, tried that:
gh = gdk.geometry() gh.min_aspect = 0.5 gh.max_axpect = 0.5 w.set_geometry_hints(none, gh, gdk.windowhints.aspect)
however, still can resize window aspect want. missing?
use gtk_window_set_geometry_hints(). need utilize min_aspect , max_aspect fields in gdkgeometry structure.
python gtk
No comments:
Post a Comment