Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

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
1 changed files with 6 additions and 8 deletions

View File

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