This commit is contained in:
2025-06-30 22:19:19 +02:00
parent 915dabe9e2
commit e409d7153c
7 changed files with 129 additions and 2 deletions
+27
View File
@@ -0,0 +1,27 @@
---
title: Screen
slug: /screen
---
`Screen` is a OSUI structure that allows the program to use osui elements and it's extensions.
<img src="/img/diagrams/screen.png" alt="Diagram" width="600"/>
### `Screen::new()`
Creates a new `Screen` structure with empty widgets and extensions.
### `draw(&mut self, element: E) -> &Arc<Widget>`
Adds a element to the widgets array and returns the widget for extra parameters.
### `extension(&mut self, ext: E)`
Adds a extension to the extensions array.
### `run(&mut self) -> std::io::Result<()>`
Runs the app with the elements and extension provided.
### `render(&self) -> std::io::Result<()>`
> :::warning
> Do not run this function if you don't know what you're doing, this function may cause a mutex deadlock.
### `render_extension(&self, wi: Arc<Widget>) -> std::io::Result<()>`
> :::warning
> Do not run this function if you don't know what you're doing, this function may cause a mutex deadlock.