mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Remove viewport_id and parent_viewport_id from Window::show arguments because can be accessed from Context::get_viewport_id and Context::get_parent_viewport_id
This commit is contained in:
@@ -53,7 +53,7 @@ impl ThreadState {
|
||||
let title = self.data.read().unwrap().title.clone();
|
||||
egui::Window::new(title)
|
||||
.default_pos(pos)
|
||||
.show(ctx, move |ui, _, _| {
|
||||
.show(ctx, move |ui| {
|
||||
let data = &mut *clone.data.write().unwrap();
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Your name: ");
|
||||
@@ -147,10 +147,11 @@ impl eframe::App for MyApp {
|
||||
return;
|
||||
}
|
||||
let data = self.data.clone();
|
||||
egui::Window::new("Main thread").show(ctx, move |ui, _, parent_id| {
|
||||
egui::Window::new("Main thread").show(ctx, move |ui| {
|
||||
if ui.button("Spawn another thread").clicked() {
|
||||
data.write().unwrap().spawn_thread();
|
||||
ui.ctx().request_repaint_viewport(parent_id);
|
||||
ui.ctx()
|
||||
.request_repaint_viewport(ui.ctx().get_parent_viewport_id());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user