2017-01-07 09:01:48 +01:00
|
|
|
from gi.repository import Gtk
|
|
|
|
|
|
|
|
from sugar3.graphics.toolbarbox import ToolbarBox
|
|
|
|
from sugar3.graphics.colorbutton import ColorToolButton
|
|
|
|
|
|
|
|
|
|
|
|
import common
|
|
|
|
|
|
|
|
|
|
|
|
test = common.Test()
|
|
|
|
test.show()
|
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
|
|
test.pack_start(box, True, True, 0)
|
|
|
|
box.show()
|
2017-01-07 09:01:48 +01:00
|
|
|
|
|
|
|
toolbar_box = ToolbarBox()
|
2017-01-11 18:23:08 +01:00
|
|
|
box.pack_start(toolbar_box, False, False, 0)
|
2017-01-07 09:01:48 +01:00
|
|
|
toolbar_box.show()
|
|
|
|
|
|
|
|
separator = Gtk.SeparatorToolItem()
|
|
|
|
toolbar_box.toolbar.insert(separator, -1)
|
|
|
|
separator.show()
|
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
|
2017-01-07 09:01:48 +01:00
|
|
|
def color_changed_cb(button, pspec):
|
|
|
|
print button.get_color()
|
|
|
|
|
2017-01-11 18:23:08 +01:00
|
|
|
|
2017-01-07 09:01:48 +01:00
|
|
|
color_button = ColorToolButton()
|
|
|
|
color_button.connect("notify::color", color_changed_cb)
|
|
|
|
toolbar_box.toolbar.insert(color_button, -1)
|
|
|
|
color_button.show()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
common.main(test)
|