mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Add some documentation
This commit is contained in:
@@ -301,6 +301,7 @@ impl<'open> Window<'open> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 `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.
|
/// Returns `Some(InnerResponse { inner: None })` if the window is collapsed.
|
||||||
#[inline]
|
#[inline]
|
||||||
@@ -312,6 +313,7 @@ impl<'open> Window<'open> {
|
|||||||
self.show_dyn(ctx, Box::new(add_contents))
|
self.show_dyn(ctx, Box::new(add_contents))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// You will probably need to put your state in a ```Arc<RwLock<T>>```
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn show_async(self, ctx: &Context, add_contents: impl Fn(&mut Ui) + Send + Sync + 'static) {
|
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));
|
self.show_dyn_async(ctx, Box::new(add_contents));
|
||||||
|
|||||||
@@ -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
|
/// When this is called the current viewport will be paused
|
||||||
/// This will render in a native window if he can!
|
/// This will render in a native window if he can!
|
||||||
/// When this finishes then the last viewport will continue drawing
|
/// When this finishes then the last viewport will continue drawing
|
||||||
|
|||||||
Reference in New Issue
Block a user