2016-06-14 13:14:16 -04:00

36 lines
1004 B
Python
Executable File

#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class MyWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title = "Hello World!")
self.box = Gtk.Box(orientation = Gtk.Orientation.VERTICAL, spacing = 6)
self.add(self.box)
stack = Gtk.Stack()
stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
stack.set_transition_duration(1000)
checkbutton = Gtk.CheckButton("Click me!")
stack.add_titled(checkbutton, "check", "CheckButton")
label = Gtk.Label()
label.set_markup("<big>A fancy label</big>")
stack.add_titled(label, "label", "Label")
stack_switcher = Gtk.StackSwitcher()
stack_switcher.set_stack(stack)
self.box.pack_start(stack_switcher, True, True, 0)
self.box.pack_start(stack, True, True, 0)
window = MyWindow()
window.connect("delete-event", Gtk.main_quit)
window.show_all()
Gtk.main()