(self, widget)
Set the urgency hint/icon/flash for our window
Set the urgency hint/icon/flash for our window
Set the urgency hint / icon / flash for our window
def on_bell(self, widget):
        """Set the urgency hint/icon/flash for our window"""
        if self.config['urgent_bell']:
            window = self.get_toplevel()
            if window.is_toplevel():
                window.set_urgency_hint(True)
        if self.config['icon_bell']:
            self.titlebar.icon_bell()
        if self.config['visible_bell']:
            # Repurposed the code used for drag and drop overlay to provide a visual terminal flash
            alloc = widget.get_allocation()

            if self.config['use_theme_colors']:
                color = self.vte.get_style_context().get_color(Gtk.StateType.NORMAL)  # VERIFY FOR GTK3 as above
            else:
                color = Gdk.RGBA()
                color.parse(self.config['foreground_color'])  # VERIFY FOR GTK3

            coord = ((0, 0), (alloc.width, 0), (alloc.width, alloc.height), (0, alloc.height))

            # here, we define some widget internal values
            widget._draw_data = { 'color': color, 'coord' : coord }
            # redraw by forcing an event
            connec = widget.connect_after('draw', self.on_draw)
            widget.queue_draw_area(0, 0, alloc.width, alloc.height)
            widget.get_window().process_updates(True)
            # finaly reset the values
            widget.disconnect(connec)
            widget._draw_data = None

            # Add timeout to clean up display
            GObject.timeout_add(100, self.on_bell_cleanup, widget, alloc)
def on_bell ( self , widget ) : if self . config [ 'urgent_bell' ] : window = self . get_toplevel ( ) if window . is_toplevel ( ) : window . set_urgency_hint ( True ) if self . config [ 'icon_bell' ] : self . titlebar . icon_bell ( ) if self . config [ 'visible_bell' ] : # Repurposed the code used for drag and drop overlay to provide a visual terminal flash alloc = widget . get_allocation ( ) if self . config [ 'use_theme_colors' ] : color = self . vte . get_style_context ( ) . get_color ( Gtk . StateType . NORMAL ) # VERIFY FOR GTK3 as above else : color = Gdk . RGBA ( ) color . parse ( self . config [ 'foreground_color' ] ) # VERIFY FOR GTK3 coord = ( ( 0 , 0 ) , ( alloc . width , 0 ) , ( alloc . width , alloc . height ) , ( 0 , alloc . height ) ) # here, we define some widget internal values widget . _draw_data = { 'color' : color , 'coord' : coord } # redraw by forcing an event connec = widget . connect_after ( 'draw' , self . on_draw ) widget . queue_draw_area ( 0 , 0 , alloc . width , alloc . height ) widget . get_window ( ) . process_updates ( True ) # finaly reset the values widget . disconnect ( connec ) widget . _draw_data = None # Add timeout to clean up display GObject . timeout_add ( 100 , self . on_bell_cleanup , widget , alloc )