Reputation: 9421
I would like to set the max / min size of a gtk.Paned
container. At the moment the gutter can move such that an image in one child overlaps into the second!
I tried writing to the min-position
property of the Paned
but it's not writable.
Is this even possible?
Upvotes: 1
Views: 1942
Reputation: 18139
Make a Panned Widget, add two Gtk.Bin's to either of its panes (or just one if you only care about one size), and set your minimum sizes requests on the Bin containers. widget.set_size_request(my_min_width, -1)
, -1
to unset height size request; or get its previous minimum size request after the widget has been realized. widget.connect('realize', my_handler)
and def my_handler(widget): widget.get_preferred_size()[0].height
.
Upvotes: 1
Reputation: 741
Gtk_Paned's min-position and max-position are read only values that derive their original values from the widgets (child widget) that are panned together. In order to set the minimum an maximum position you have to limit the shrink-ability and expandability of those widgets (or via layout's horizontal and vertical adjustments). It completely depends on the kind of widgets that you are trying to pan together.
Upvotes: 0
Reputation: 11454
I think this is not the role of the GtkPaned, it barely will follow the minimum size allocation of what is the childs. This is where I'd look.
Upvotes: 0