I have the following code which adds a toolbar icon “gtk-info” (from stock) to a python Gtk+ window. I would like to have a custom icon instead. How would I do that?
self.action = ('ActivateSqueezeboxMode','gtk-info', _('SqueezeboxTools'),
None, _('Activate Squeezebox mode'),
self.activate_button_press, True)
self.action_group = gtk.ActionGroup('SqueezeboxPluginActions')
self.action_group.add_toggle_actions([self.action])
uim = self.shell.get_ui_manager()
uim.insert_action_group (self.action_group, 0)
self.ui_id = uim.add_ui_from_string(context_ui)
uim.ensure_update()
Try this:
to use a named icon, or
as the last line to use a
gio.Icon(see for examplegio.FileIcon.)