API ReferenceEnvironment
Title
Retained window title with opaque-color-native bridge.
TitleController owns title state shared by rebuilds and the native bridge;
Title binds it to a subtree with an optional sink.
use incular::prelude::*;
fn main() {
let controller =
TitleController::try_new("Incular", Color::BLACK).expect("opaque color");
println!("accepted: {}", controller.set_title("New title"));
println!(
"color accepted: {}",
controller.set_color(Color::BLACK).expect("opaque color")
);
println!(
"set both: {}",
controller
.set("Title", Color::BLACK)
.expect("opaque color")
);
println!("title: {}", controller.data().title);
controller.synchronize();
let app = Application::new(|_cx| {
Title::simple("Incular", Text::new("Hi")).into()
})
.expect("valid application");
incular::run(app).expect("run application");
}TitleData { title: String, color: Color }.
TitleError::TransparentColor (title colors must be opaque).
WindowChromeSink trait: set_title(&str) -> bool,
set_application_color(Color) -> bool (default false);
NoopWindowChromeSink declines everything (headless).
Related: Application,
WindowHandle.