How to detect a change in GtkStack or GtkStackSwitcher

What I'm trying to do is detect when the user changes the visible child in GtkStack.

I use GtkStackSwitcher as a visible way to display buttons in accordance with this design:

pic

So - when a person presses / toggles one of these buttons, I want to do some processing.

What event should be connected to achieve this?

I looked at Gtk.Stack and Gtk.StackSwitcher , but I do not see any obvious signals. Any thoughts on how best to act?

They are not standard buttons - therefore, the “clicked” event, which, I think, does not apply in this scenario.

I am using Ubuntu 14.04 Gtk + 3.10, python3

+4
1

visible-child - , . notify, :

def vc_changed(stack, gparamstring):
    print "visible child changed"

my_stack.connect("notify::visible-child", vc_changed)
+6

All Articles