Reputation: 319
I'm using Gtk to build an application on Linux using Python 3. I'm trying to use a Gtk.HeaderBar. So far it's been working Ok, but it seems that I can't get it to expand it's child widgets. For example:
As you can see above, I've tried putting my Gtk.Entry into the Gtk.HeaderBar, but even with things like Gtk.Entry.set_hexpand(True) it simply refuses to expand. I've even tried putting it inside a Gtk.Box, expanding the Gtk.Box, then adding the Gtk.Entry inside that. Even when I set the Gtk.Entry as a custom title for the Gtk.HeaderBar, this happens:
What's causing this? How can I fix it?
Upvotes: 2
Views: 958
Reputation: 11578
Enabling hexpand
only says that you want the widget to be allocated all the remaining space; it does not actually resize your widget. You want the halign
property set to GTK_ALIGN_FILL
(or whatever it's called in Python) in addition to hexpand.
Check the diagrams on this page for a visual explanation.
Upvotes: 1