Closed bennett-nguyen closed 1 year ago
See:
def on_close_window_button_pressed(self):
"""
Override this method to call 'hide()' instead if you want to hide a window when the
close button is pressed.
"""
self.kill()
To be clear:
You would do:
class SettingsWindow(pg_gui.elements.UIWindow):
def on_close_window_button_pressed(self):
self.hide()
settings_window = SettingsWindow(
window_rect,
manager=manager,
window_display_title="Settings",
)
And remove the part in the event handler responding to the UI_WINDOW_CLOSE event.
Does this also apply to other UI components of the API? Also, I think you should highlight this notice in the docs so it doesn't cause any confusion.
Describe the bug I'm fairly new to this library, but I'll try to explain the bug as concise as possible. I'm implementing a settings window where you can toggle/untoggle it via pressing the
Q
key on the keyboard, you can also untoggle the settings window via its close button. However, after I clicked the window's close button, I'm not able to toggle it anymore.To Reproduce Implement this code:
Expected behaviour I'm supposed to be able to toggle it after I closed it.
Screenshots
Platform and software: