cushy/examples/window-properties.rs
Jonathan Johnson f1a2a711ff
Multi-window support
Closes #91

There's some details to still figure out, which are in new issues:

- #109: When opening a window, no handle is returned that gives access to the
  window from the opener. Technically this can all be wired up manually,
  with exception of requeesting the window close.
- #107: How can a window close itself? Once we have a handle type, we still
  need a mechanism to allow a button on a window request that the window
  closes gracefully. The examples that currently close the window
  call exit instad.
2023-12-21 14:57:29 -08:00

23 lines
707 B
Rust

use gooey::value::Dynamic;
use gooey::widget::{MakeWidget, WidgetInstance};
use gooey::Run;
use kludgine::figures::Size;
fn main() -> gooey::Result {
let focused = Dynamic::new(false);
let occluded = Dynamic::new(false);
let inner_size = Dynamic::new(Size::default());
let widgets = focused
.map_each(|v| format!("focused: {:?}", v))
.and(occluded.map_each(|v| format!("occluded: {:?}", v)))
.and(inner_size.map_each(|v| format!("inner_size: {:?}", v)))
.into_rows()
.centered();
gooey::window::Window::<WidgetInstance>::for_widget(widgets)
.focused(focused)
.occluded(occluded)
.inner_size(inner_size)
.run()
}