@@ -362,7 +362,6 @@ class Widget(Base):
362362 ]
363363 configured : bool
364364 force_menu_draw_focus : bool
365- is_scrollable : bool
366365 last_surface : pygame .Surface | None
367366 lock_position : bool
368367 readonly : bool
@@ -380,12 +379,18 @@ def __init__(
380379 args = None ,
381380 kwargs = None ,
382381 * ,
382+ active : bool = False ,
383+ accept_events : bool = False ,
384+ scrollable : bool = False ,
383385 selectable : bool = True ,
386+ selection_effect_draw_post : bool = True ,
384387 visible : bool = True ,
385388 ) -> None :
386389 super ().__init__ (object_id = widget_id )
387390
388- self ._accept_events = False # Indicate the widget receives events (info)
391+ self ._accept_events = (
392+ accept_events # Indicate the widget receives events (info)
393+ )
389394 self ._alignment = ALIGN_CENTER # Widget alignment
390395 self ._background_color = None
391396 self ._background_inflate = (0 , 0 )
@@ -506,7 +511,7 @@ def __init__(
506511 # NullSelection was created. Initially it was None
507512 self ._selection_effect = pygame_menu .widgets .NoneSelection ()
508513 # If False, the selection effect is drawn previous the widget surface
509- self ._selection_effect_draw_post = True
514+ self ._selection_effect_draw_post = selection_effect_draw_post
510515
511516 # Inputs
512517 self ._ctrl = Controller ()
@@ -520,10 +525,12 @@ def __init__(
520525
521526 # Public statutes. These values can be changed without calling for
522527 # methods (safe to update)
523- self .active = False # Widget requests focus if selected
528+ self .active = active # Widget requests focus if selected
524529 self .configured = False # Widget has been configured
525530 self .force_menu_draw_focus = False # If True Menu draw focus if widget is selected, don't consider the previous requisites
526- self .is_scrollable = False # Some widgets can be scrolled, such as the Frame
531+ self .is_scrollable = (
532+ scrollable # Some widgets can be scrolled, such as the Frame
533+ )
527534 self .is_selectable = selectable # Some widgets cannot be selected like labels
528535 self .last_surface = None # Stores the last surface the widget has been drawn
529536 self .lock_position = False # If True, the widget don't update the position if .set_position() is executed
0 commit comments