mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Fixed example
This commit is contained in:
@@ -42,7 +42,12 @@ fn main() -> Result<(), eframe::Error> {
|
|||||||
egui::Window::new("Test1").embedded(embedded).show(
|
egui::Window::new("Test1").embedded(embedded).show(
|
||||||
ctx,
|
ctx,
|
||||||
move |ui, id, parent_id| {
|
move |ui, id, parent_id| {
|
||||||
ui.checkbox(&mut *clone.write().unwrap(), "Should embedd?");
|
if ui
|
||||||
|
.checkbox(&mut *clone.write().unwrap(), "Should embedd?")
|
||||||
|
.clicked()
|
||||||
|
{
|
||||||
|
ui.ctx().request_repaint_viewport(parent_id);
|
||||||
|
}
|
||||||
let ctx = ui.ctx().clone();
|
let ctx = ui.ctx().clone();
|
||||||
ui.label(format!(
|
ui.label(format!(
|
||||||
"Current rendering window: {}",
|
"Current rendering window: {}",
|
||||||
@@ -56,8 +61,13 @@ fn main() -> Result<(), eframe::Error> {
|
|||||||
egui::CollapsingHeader::new("Shout Test2").show(ui, |ui| {
|
egui::CollapsingHeader::new("Shout Test2").show(ui, |ui| {
|
||||||
egui::Window::new("Test2")
|
egui::Window::new("Test2")
|
||||||
.embedded(embedded)
|
.embedded(embedded)
|
||||||
.show(ctx, move |ui, _, _| {
|
.show(ctx, move |ui, _, parent_id| {
|
||||||
ui.checkbox(&mut *clone.write().unwrap(), "Should embedd?");
|
if ui
|
||||||
|
.checkbox(&mut *clone.write().unwrap(), "Should embedd?")
|
||||||
|
.clicked()
|
||||||
|
{
|
||||||
|
ui.ctx().request_repaint_viewport(parent_id);
|
||||||
|
}
|
||||||
let ctx = ui.ctx().clone();
|
let ctx = ui.ctx().clone();
|
||||||
ui.label(format!(
|
ui.label(format!(
|
||||||
"Current rendering window: {}",
|
"Current rendering window: {}",
|
||||||
|
|||||||
Reference in New Issue
Block a user