(self, widget: Widget, index: int = 0, canvas: str = None)
Add widget override.
Add widget override.
Add widget override .
def add_widget(self, widget: Widget, index: int = 0, canvas: str = None):
        """ Add widget override. """
        if (widget.__class__ == blocks.PrintBlock and
            any(map(lambda w: w.__class__ == blocks.PrintBlock, self.children))):
            Notification(title='Warning',
                         message='Only one print block allowed!').open()
            return
        if not self.children:
            self.parent.parent.parent.remove_hint()
        super().add_widget(widget, index, canvas)
def add_widget ( self , widget : Widget , index : int = 0 , canvas : str = None ) : if ( widget . __class__ == blocks . PrintBlock and any ( map ( lambda w : w . __class__ == blocks . PrintBlock , self . children ) ) ) : Notification ( title = 'Warning' , message = 'Only one print block allowed!' ) . open ( ) return if not self . children : self . parent . parent . parent . remove_hint ( ) super ( ) . add_widget ( widget , index , canvas )