1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 23:13:13 -04:00

Add some documentation

This commit is contained in:
Konkitoman
2023-08-25 12:20:55 +03:00
parent 4d01644b33
commit e5a97d14ad
2 changed files with 3 additions and 0 deletions

View File

@@ -301,6 +301,7 @@ impl<'open> Window<'open> {
}
impl<'open> Window<'open> {
/// You can only use this on the main thread, or use ```Window::show_async```
/// Returns `None` if the window is not open (if [`Window::open`] was called with `&mut false`).
/// Returns `Some(InnerResponse { inner: None })` if the window is collapsed.
#[inline]
@@ -312,6 +313,7 @@ impl<'open> Window<'open> {
self.show_dyn(ctx, Box::new(add_contents))
}
/// You will probably need to put your state in a ```Arc<RwLock<T>>```
#[inline]
pub fn show_async(self, ctx: &Context, add_contents: impl Fn(&mut Ui) + Send + Sync + 'static) {
self.show_dyn_async(ctx, Box::new(add_contents));

View File

@@ -2307,6 +2307,7 @@ impl Context {
}
}
/// This can only be called in the main thread, you can use ```Context::create_viewport_async```
/// When this is called the current viewport will be paused
/// This will render in a native window if he can!
/// When this finishes then the last viewport will continue drawing