2012-11-01 14:23:49 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
from gi.repository import Gtk
|
|
|
|
|
|
|
|
from sugar3.graphics.icon import Icon
|
|
|
|
|
|
|
|
import common
|
|
|
|
test = common.Test()
|
|
|
|
test.show()
|
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
2012-11-01 14:23:49 +01:00
|
|
|
test.pack_start(box, True, True, 0)
|
|
|
|
box.show()
|
|
|
|
|
|
|
|
# notebook without button
|
|
|
|
|
|
|
|
notebook = Gtk.Notebook()
|
|
|
|
box.pack_start(notebook, True, True, 0)
|
|
|
|
notebook.show()
|
|
|
|
|
|
|
|
for i in range(3):
|
2017-01-11 18:23:08 +01:00
|
|
|
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
2012-11-01 14:23:49 +01:00
|
|
|
notebook.append_page(hbox, Gtk.Label('Page %d' % (i + 1)))
|
|
|
|
hbox.show()
|
|
|
|
|
2013-05-18 04:48:47 +02:00
|
|
|
# notebook with buttons
|
2012-11-01 14:23:49 +01:00
|
|
|
|
|
|
|
notebook = Gtk.Notebook()
|
|
|
|
box.pack_start(notebook, True, True, 0)
|
|
|
|
notebook.show()
|
|
|
|
|
|
|
|
add_icon = Icon(icon_name='add')
|
|
|
|
button = Gtk.Button()
|
|
|
|
button.props.focus_on_click = False
|
|
|
|
button.add(add_icon)
|
|
|
|
add_icon.show()
|
|
|
|
|
|
|
|
notebook.set_action_widget(button, Gtk.PackType.END)
|
|
|
|
button.show()
|
|
|
|
|
|
|
|
for i in range(3):
|
2017-01-11 18:23:08 +01:00
|
|
|
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
2012-11-01 14:23:49 +01:00
|
|
|
notebook.append_page(hbox, Gtk.Label('Page %d' % (i + 1)))
|
|
|
|
hbox.show()
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
common.main(test)
|