Reputation: 2873
I'd like to set an icon as titled into a Gtk.StackSwitcher with pyGTK.
Is it possible? I didn't see in the documentation.
Thanks in advance!
Upvotes: 0
Views: 471
Reputation: 1195
Do you mean Gtk.StackSwitcher ? Gtk.Stack is the empty container in which Gtk.StackSwitcher becomes the "header"
from gi.repository import Gtk
win = Gtk.Window ()
grid = Gtk.Grid ()
win.add (grid)
stack = Gtk.Stack ()
childstack = Gtk.Entry ()
stack.add_titled (childstack, "_Namestack", "LabelInTheSwitcher")
grid.attach (stack, 0, 1, 1, 1)
switcher = Gtk.StackSwitcher ()
switcher.set_stack (stack)
grid.attach (switcher, 0, 0, 1, 1)
""" Use icon instead for your switcher """
stack.child_set_property (childstack, "icon-name", "help-about")
win.show_all ()
win.connect ("destroy", Gtk.main_quit)
Gtk.main ()
Upvotes: 2