What I'm trying to-do is detect when a user changes the visible child in a GtkStack.
I'm using a GtkStackSwitcher as a visible way to display buttons as per this design:
Thus - when a person clicks/toggles one of those buttons I want to perform some processing.
Which event should I connect to achieve this?
I've looked at both Gtk.Stack and Gtk.StackSwitcher but I dont see any obvious signals. Any thoughts on the best way to proceed?
These don't appear to be standard buttons - so a 'clicked' event I dont think applies in this scenario.
I'm using Ubuntu 14.04 Gtk+3.10, python3
visible-child
is the property you are looking for. Use the notify
signal to get notified of changes:
def vc_changed(stack, gparamstring):
print("visible child changed")
my_stack.connect("notify::visible-child", vc_changed)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With