Changeset 2303

Show
Ignore:
Timestamp:
05/19/08 13:28:38 (7 months ago)
Author:
wrobe..@pld-linux.org
Message:

- set default icons for gaphor windows

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/ui/toplevelwindow.py

    r1289 r2303  
    22Basic stuff for toplevel windows. 
    33""" 
     4 
     5import os.path 
     6import pkg_resources 
    47 
    58import gtk 
     
    811from interfaces import IUIComponent 
    912 
     13ICONS = ( 
     14    'gaphor-24x24.png', 
     15    'gaphor-48x48.png', 
     16    'gaphor-96x96.png', 
     17    'gaphor-256x256.png', 
     18) 
    1019 
    1120class ToplevelWindow(object): 
     
    2433        self.window.set_size_request(*self.size) 
    2534        self.window.set_resizable(True) 
     35 
     36        # set default icons of gaphor windows 
     37        icon_dir = os.path.abspath(pkg_resources.resource_filename('gaphor.ui', 'pixmaps')) 
     38        icons = (gtk.gdk.pixbuf_new_from_file(os.path.join(icon_dir, f)) for f in ICONS) 
     39        self.window.set_icon_list(*icons) 
    2640 
    2741        self.window.add_accel_group(self.ui_manager.get_accel_group())