//! This is the code that will be generated by the macro (a simplified version): //! //! ```no_run //! #[derive(Default, Debug)] //! struct Example { //! foo: bool, //! bar: [f32; 2], //! } //! //! struct __Example_Events { //! foo: bool, //! bar: bool, //! click: bool, //! } //! //! impl imgui_ext::Gui for Example { //! type Events = __Example_Events; //! fn draw_gui(ui: &imgui::Ui, ext: &mut Self) -> Self::Events { //! let foo_params = imgui_ext::CheckboxParams { //! label: imgui::im_str!("foo"), //! }; //! let bar_params = imgui_ext::SliderParams { //! label: imgui::im_str!("bar"), //! min: -1.0, //! max: 1.0, //! power: None, //! format: None, //! }; //! //! __Example_Events { //! foo: imgui_ext::Checkbox::build(ui, &mut ext.foo, foo_params), //! bar: imgui_ext::Slider::build(ui, &mut ext.bar, bar_params), //! click: ui.button(imgui::im_str!("Click")), //! } //! } //! } //! ``` mod support; #[derive(imgui_ext::Gui, Default, Debug)] struct Example { #[imgui(checkbox)] foo: bool, #[imgui( slider(min = "-1.0", max = "1.0"), button(label = "Click", catch = "click") )] bar: [f32; 2], } fn main() { support::demo().run_debug::(|_, _| {}); }