sugar-toolkit-gtk3/examples/notebook.py
Simon Schampijer b9a19e952f Add examples for Alert, Animator, ComboBox, IconEntry and Notebook
Signed-off-by: Simon Schampijer <simon@schampijer.de>
[squashed two patches into one]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
2011-12-13 17:19:53 -03:00

33 lines
617 B
Python

from gi.repository import Gtk
from sugar3.graphics.notebook import Notebook
def _destroy_cb(widget, data=None):
Gtk.main_quit()
w = Gtk.Window()
w.connect("destroy", _destroy_cb)
box = Gtk.VBox()
w.add(box)
nb = Notebook(can_close_tabs=True)
box.pack_start(nb, False, False, 0)
for i in range(5):
bufferf = "Prepend Frame %d" % (i+1)
bufferl = "PPage %d" % (i+1)
frame = Gtk.Frame()
frame.set_border_width(10)
frame.set_size_request(100, 75)
label = Gtk.Label(bufferf)
frame.add(label)
label.show()
nb.add_page(bufferl, frame)
frame.show()
w.show_all()
Gtk.main()