Write documentation for sugar3.graphics.ColorToolButton
- add one example, - part of feature Sugar3 Docs, https://wiki.sugarlabs.org/go/Features/Sugar3_Docs Added documentation and example for Colorbutton
This commit is contained in:
committed by
Ignacio Rodríguez
parent
a735c7a6ce
commit
f4fc8c0d1f
@@ -0,0 +1,35 @@
|
||||
from gi.repository import Gtk
|
||||
|
||||
from sugar3.graphics.toolbarbox import ToolbarBox
|
||||
from sugar3.graphics.colorbutton import ColorToolButton
|
||||
|
||||
|
||||
import common
|
||||
|
||||
|
||||
test = common.Test()
|
||||
test.show()
|
||||
|
||||
vbox = Gtk.VBox()
|
||||
test.pack_start(vbox, True, True, 0)
|
||||
vbox.show()
|
||||
|
||||
toolbar_box = ToolbarBox()
|
||||
vbox.pack_start(toolbar_box, False, False, 0)
|
||||
toolbar_box.show()
|
||||
|
||||
separator = Gtk.SeparatorToolItem()
|
||||
toolbar_box.toolbar.insert(separator, -1)
|
||||
separator.show()
|
||||
|
||||
def color_changed_cb(button, pspec):
|
||||
print button.get_color()
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user