Implement ToggleIconButton

This commit is contained in:
Marco Pesenti Gritti
2007-03-09 11:22:51 +01:00
parent e9f3099635
commit cda47a41f4
5 changed files with 85 additions and 3 deletions
+8
View File
@@ -23,12 +23,16 @@ import hippo
from sugar.graphics.toolbar import Toolbar
from sugar.graphics.iconbutton import IconButton
from sugar.graphics.toggleiconbutton import ToggleIconButton
from sugar.graphics.button import Button
from sugar.graphics.entry import Entry
def _button_activated_cb(button):
print "_button_activated_cb"
def _toggled_changed_cb(button, pspec):
print "Toggle state: %d" % button.props.toggled
window = gtk.Window()
window.connect("destroy", lambda w: gtk.main_quit())
window.show()
@@ -48,6 +52,10 @@ for i in [1, 2]:
icon_button = IconButton(icon_name='theme:stock-close')
toolbar.append(icon_button)
toggle = ToggleIconButton(icon_name='theme:stock-back')
toggle.connect('notify::toggled', _toggled_changed_cb)
toolbar.append(toggle)
button = Button(text='Click me!', icon_name='theme:stock-close')
button.connect('activated', _button_activated_cb)
toolbar.append(button)