@@ -465,7 +465,7 @@ def test_function(data):
465
465
manager = default_ui_manager ,
466
466
command = test_function )
467
467
468
- assert button .handler [pygame_gui .UI_BUTTON_PRESSED ] == test_function
468
+ assert button ._handler [pygame_gui .UI_BUTTON_PRESSED ] == test_function
469
469
470
470
assert not button_clicked
471
471
# process a mouse button down event
@@ -498,13 +498,13 @@ def test_function(data):
498
498
tool_tip_text = "This is a test of the button's tool tip functionality." ,
499
499
manager = default_ui_manager )
500
500
501
- assert pygame_gui .UI_BUTTON_PRESSED not in button .handler
501
+ assert pygame_gui .UI_BUTTON_PRESSED not in button ._handler
502
502
503
503
button .bind (pygame_gui .UI_BUTTON_PRESSED , test_function )
504
- assert button .handler [pygame_gui .UI_BUTTON_PRESSED ] == test_function
504
+ assert button ._handler [pygame_gui .UI_BUTTON_PRESSED ] == test_function
505
505
506
506
button .bind (pygame_gui .UI_BUTTON_PRESSED , None )
507
- assert pygame_gui .UI_BUTTON_PRESSED not in button .handler
507
+ assert pygame_gui .UI_BUTTON_PRESSED not in button ._handler
508
508
509
509
with pytest .raises (TypeError , match = "Button command function must be callable" ):
510
510
button .bind (pygame_gui .UI_BUTTON_PRESSED , "non-callable" )
@@ -537,9 +537,9 @@ def test_function2(data):
537
537
manager = default_ui_manager ,
538
538
command = command_dict )
539
539
540
- assert button .handler [pygame_gui .UI_BUTTON_START_PRESS ] == test_function # not
541
- assert button .handler [pygame_gui .UI_BUTTON_PRESSED ] == test_function2
542
- assert pygame_gui .UI_BUTTON_DOUBLE_CLICKED not in button .handler
540
+ assert button ._handler [pygame_gui .UI_BUTTON_START_PRESS ] == test_function # not
541
+ assert button ._handler [pygame_gui .UI_BUTTON_PRESSED ] == test_function2
542
+ assert pygame_gui .UI_BUTTON_DOUBLE_CLICKED not in button ._handler
543
543
544
544
assert not button_start_press
545
545
button .on_button_event (pygame_gui .UI_BUTTON_START_PRESS , {'mouse_button' :1 })
0 commit comments