// run using `cargo run --example menu --features=json5` use fltk::{prelude::*, *}; use fltk_decl::DeclarativeApp; fn main() { #[cfg(feature = "json5")] DeclarativeApp::new_json5(200, 300, "MyApp", "examples/menu.json") .run(|_win| { if let Some(mut choice) = app::widget_from_id::("choice") { choice.add_choice("JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC"); choice.set_callback(|c| { if let Some(mut label) = app::widget_from_id::("label") { label.set_label(&format!("{:?}", c.choice())); } }); } }) .unwrap(); }