I am trying to add a Gtk stock icon to my window. Here is the code:
#! /usr/bin/python from gi.repository import Gtk class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title='My Window Title') self.icon = self.render_icon(Gtk.STOCK_FLOPPY, 1) self.set_icon(self.icon) self.connect('delete-event', Gtk.main_quit) win = MyWindow() win.show_all() Gtk.main()
AttributeError: 'gi.repository.Gtk' object has no attribute 'ICON_SIZE_SMALL_TOOLBAR'
If I set the icon size to the literal 1 the script works. I'm sure this has to do something with Gtk or PyGtk versions, but I can't figure what I am doing wrong. Thanks in advance and sorry for the novice question.