-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* GUI: Add UIView * Fix docs * expose UIView * fix imports
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from arcade import View | ||
from arcade.gui import UIManager | ||
|
||
|
||
class UIView(View): | ||
"""This view provides basic GUI setup. | ||
This is a convenience class, which adds the UIManager to the view under `self.ui`. | ||
The UIManager is enabled when the view is shown and disabled when the view is hidden. | ||
If you override ``on_show_view`` or ``on_show_view``, | ||
don't forget to call super().on_show_view() or super().on_hide_view(). | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self.ui = UIManager() | ||
|
||
def on_show_view(self): | ||
self.ui.enable() | ||
|
||
def on_hide_view(self): | ||
self.ui.disable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters