This commit is contained in:
Nathan Sobo 2023-08-01 20:53:15 -06:00
parent 6f6096238d
commit 1dfde8eab5
15 changed files with 647 additions and 106 deletions

View file

@ -161,6 +161,19 @@ impl TestAppContext {
(window_id, view)
}
pub fn add_window2<T, F>(&mut self, build_root_view: F) -> WindowHandle<T>
where
T: View,
F: FnOnce(&mut ViewContext<T>) -> T,
{
let (window_id, view) = self
.cx
.borrow_mut()
.add_window(Default::default(), build_root_view);
self.simulate_window_activation(Some(window_id));
(window_id, view)
}
pub fn add_view<T, F>(&mut self, window_id: usize, build_view: F) -> ViewHandle<T>
where
T: View,