Reputation: 1254
Is possible get the index of visible in Gtk.Stack?
Example:
>>> stack = Gtk.Stack()
>>> stack.add_named(any_widget1, 'any_widget1') # Index 0
>>> stack.add_named(any_widget2, 'any_widget2') # Index 1
>>> stack.add_named(any_widget3, 'any_widget3') # Index 2
>>>
>>> stack.get_visible_child_index()
0
This is possible?
Upvotes: 1
Views: 313
Reputation: 14587
The Stack documentation includes position
child property:
child = stack.get_visible_child()
if child is not None:
position = stack.child_get_property(child, "position")
Upvotes: 3