(self, requested_icon)
Set the window icon
Set the window icon
Set the window icon
def apply_icon(self, requested_icon):
        """Set the window icon"""
        icon_theme = Gtk.IconTheme.get_default()
        icon_name_list = [APP_NAME]   # disable self.wmclass_name, n/a in GTK3

        if requested_icon:
            try:
                self.set_icon_from_file(requested_icon)
                return
            except (NameError, GObject.GError):
                dbg('Unable to load %s icon as file' % (repr(requested_icon)))

            icon_name_list.insert(0, requested_icon)

        for icon_name in icon_name_list:
            # Test if the icon is available first
            if icon_theme.lookup_icon(icon_name, 48, 0):
                self.set_icon_name(icon_name)
                return # Success! We're done.
            else:
                dbg('Unable to load %s icon' % (icon_name))

        icon = self.render_icon(Gtk.STOCK_DIALOG_INFO, Gtk.IconSize.BUTTON)
        self.set_icon(icon)
def apply_icon ( self , requested_icon ) : icon_theme = Gtk . IconTheme . get_default ( ) icon_name_list = [ APP_NAME ] # disable self.wmclass_name, n/a in GTK3 if requested_icon : try : self . set_icon_from_file ( requested_icon ) return except ( NameError , GObject . GError ) : dbg ( 'Unable to load %s icon as file' % ( repr ( requested_icon ) ) ) icon_name_list . insert ( 0 , requested_icon ) for icon_name in icon_name_list : # Test if the icon is available first if icon_theme . lookup_icon ( icon_name , 48 , 0 ) : self . set_icon_name ( icon_name ) return # Success! We're done. else : dbg ( 'Unable to load %s icon' % ( icon_name ) ) icon = self . render_icon ( Gtk . STOCK_DIALOG_INFO , Gtk . IconSize . BUTTON ) self . set_icon ( icon )