Checkpoint
This commit is contained in:
parent
79e1e1a747
commit
66ef5549e9
6 changed files with 47 additions and 11 deletions
|
@ -289,6 +289,18 @@ impl MainThread<AppContext> {
|
|||
})
|
||||
}
|
||||
|
||||
pub(crate) fn update_window<R>(
|
||||
&mut self,
|
||||
id: WindowId,
|
||||
update: impl FnOnce(&mut WindowContext) -> R,
|
||||
) -> Result<R> {
|
||||
self.0.update_window(id, |cx| {
|
||||
update(unsafe {
|
||||
std::mem::transmute::<&mut WindowContext, &mut MainThread<WindowContext>>(cx)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn platform(&self) -> &dyn Platform {
|
||||
self.platform.borrow_on_main_thread()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue