|
Image confusions: msg#00171gnome.gtk+.python
Hi, all. I'm working on a program which is going to be using a lot of icons. To make things a bit easier, I'm creating a dictionary of name/icon pairs. This works nicely for disk-loaded images, but I just tried to add in some stock icons, and I'm getting a confusing error. Here's my function: --------------- def load_images(self): file_icons = \ {'host':'host.png','dis-host':'host_disconnected.png', 'net':'network.png', 'table':'tables.png', 'view':'views.png', 'database':'database.png', 'schema':'schema.png', 'dis-database':'database_disconnected.png'} stock_icons = {'procedure': gtk.STOCK_EXECUTE } for icon in file_icons.keys(): image = gtk.Image() image.set_from_file('icons/%s' % file_icons[icon]) self.icons[icon] = image for icon in stock_icons.keys(): image = gtk.Image() image.set_from_stock(stock_icons[icon], gtk.ICON_SIZE_MENU) self.icons[icon] = image ---------------- As I said - the part loading from file_icons works fine. But when I try to use the stock icon, I get this: Traceback (most recent call last): File "./browser.py", line 391, in connect_to_host self.build_schema_tree(iter, con) File "./browser.py", line 322, in build_schema_tree self.icons['procedure'].get_pixbuf()) ValueError: image should be a GdkPixbuf or empty This call works for the disk loaded icons. What am I doing wrong for the stock icons? TIA, cf -- Colin Fox <cfox@xxxxxxxxxxxxxxx> CF Consulting Inc.
pygtk mailing list pygtk@xxxxxxxxxx http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Help with passing parameteres to a callback routine (newbie): 00171, David M. Cook |
|---|---|
| Next by Date: | Re: Image confusions: 00171, John Finlay |
| Previous by Thread: | Help with passing parameteres to a callback routine (newbie)i: 00171, Peter Stokes |
| Next by Thread: | Re: Image confusions: 00171, John Finlay |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |