Add a set_named_icon method

This commit is contained in:
Marco Pesenti Gritti 2007-05-01 11:28:06 +02:00
parent 0ebba0d454
commit b476b13673
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
gtk-theme-name = "sugar"
gtk-icon-theme-name = "sugar"
gtk-font-name = "Sans Serif 11"
gtk-font-name = "Sans Serif 10"
gtk-cursor-theme-name = "sugar"
gtk-toolbar-style = GTK_TOOLBAR_ICONS
gtk-icon-sizes = "gtk-large-toolbar=32,32"

View File

@ -22,7 +22,9 @@ from sugar.graphics.icon import Icon
class ToggleToolButton(gtk.ToggleToolButton):
def __init__(self, named_icon=None):
gtk.ToggleToolButton.__init__(self)
self.set_named_icon(named_icon)
def set_named_icon(self, named_icon)
icon = Icon(named_icon)
self.set_icon_widget(icon)
icon.show()

View File

@ -22,7 +22,9 @@ from sugar.graphics.icon import Icon
class ToolButton(gtk.ToolButton):
def __init__(self, named_icon=None):
gtk.ToolButton.__init__(self)
self.set_named_icon(named_icon)
def set_named_icon(self, named_icon):
icon = Icon(named_icon)
self.set_icon_widget(icon)
icon.show()