Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arcade/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def rect(self) -> Rect:
"""Return a Rect describing the size of the window."""
return LBWH(0, 0, self.width, self.height)

def run(self) -> None:
def run(self, view=None) -> None:
"""
Run the event loop.

Expand All @@ -411,7 +411,7 @@ def run(self) -> None:
function starting pyglet's event loop meaning it will start to dispatch
events such as ``on_draw`` and ``on_update``.
"""
arcade.run()
arcade.run(view=view)

def close(self) -> None:
"""Close the Window."""
Expand Down
6 changes: 5 additions & 1 deletion arcade/window_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def close_window() -> None:
gc.collect()


def run():
def run(view=None):
"""
Run the main loop.

Expand All @@ -108,6 +108,10 @@ def run():
"""
window = get_window()

# Show the provided view if specified
if view is not None:
window.show_view(view)

# Used in some unit test
if os.environ.get("ARCADE_TEST"):
window.on_update(1.0 / 60.0)
Expand Down