Changed all places that load icons to do it through IconFactory.

This commit is contained in:
Einar Ryeng 2007-01-03 17:30:27 +00:00
parent 57e58e3910
commit ebd4fdae7b

View File

@ -894,9 +894,8 @@ class PlotMode:
def get_icon(self):
"""Returns the icon for the PlotMode"""
fname = os.path.join(fluents.ICONDIR, self.image_file)
image = gtk.Image()
image.set_from_file(fname)
image.set_from_pixbuf(fluents.icon_factory.get(self.image_file))
return image
def activate(self):
@ -931,14 +930,14 @@ class PlotMode:
class DefaultPlotMode (PlotMode):
def __init__(self, plot):
PlotMode.__init__(self, plot, 'default', 'Default mode', 'cursor.png')
PlotMode.__init__(self, plot, 'default', 'Default mode', 'cursor')
class PanPlotMode (PlotMode):
def __init__(self, plot):
PlotMode.__init__(self, plot, 'pan',
'Pan axes with left mouse, zoom with right',
'move.png')
'move')
# Holds handler IDs for callbacks.
self._button_press = None
@ -1094,7 +1093,7 @@ class PanPlotMode (PlotMode):
class ZoomPlotMode (PlotMode):
def __init__(self, plot):
PlotMode.__init__(self, plot, 'zoom',
'Zoom to rectangle','zoom_to_rect.png')
'Zoom to rectangle','zoom_to_rect')
self._selectors = {}
def activate(self):
@ -1124,7 +1123,7 @@ class ZoomPlotMode (PlotMode):
class SelectPlotMode (PlotMode):
def __init__(self, plot):
PlotMode.__init__(self, plot, 'select',
'Select within rectangle', 'select.png')
'Select within rectangle', 'select')
self._selectors = {}
def activate(self):
@ -1175,9 +1174,8 @@ class PlotToolbar(gtk.Toolbar):
# Set up freeze button
btn = gtk.ToggleToolButton()
fname = os.path.join(fluents.ICONDIR, "freeze.png")
image = gtk.Image()
image.set_from_file(fname)
image.set_from_pixbuf(fluents.icon_factory.get('freeze'))
btn.set_icon_widget(image)
btn.connect('toggled', self._on_freeze_toggle)