def loadIcon(stock_item_id):
 stock_item = getattr(gtk, stock_item_id)
 local_icon = os.path.join(GUI_DATA_PATH, 'icons', '16', ('%s.png' % stock_item))
 if os.path.exists(local_icon):
  im = gtk.Image()
  im.set_from_file(local_icon)
  im.show()
  return im.get_pixbuf()
 else:
  icon_theme = gtk.IconTheme()
  try:
   icon = icon_theme.load_icon(stock_item, 16, ())
  except:
   icon = loadImage('missing-image.png').get_pixbuf()
  return icon

def loadIcon ( stock_item_id ) : stock_item = getattr ( gtk , stock_item_id ) local_icon = os . path . join ( GUI_DATA_PATH , 'icons' , '16' , ( '%s.png' % stock_item ) ) if os . path . exists ( local_icon ) : im = gtk . Image ( ) im . set_from_file ( local_icon ) im . show ( ) return im . get_pixbuf ( ) else : icon_theme = gtk . IconTheme ( ) try : icon = icon_theme . load_icon ( stock_item , 16 , ( ) ) except : icon = loadImage ( 'missing-image.png' ) . get_pixbuf ( ) return icon
loads an icon to show it in the gui .