Closed AllenDang closed 3 years ago
Yes, but their type is set later using the set_type method.
class UserInterface {open
} {
Function {make_window()} {open
} {
Fl_Window win {open
xywh {190 213 510 360} type Double resizable visible
} {
Fl_Browser br {selected
xywh {25 25 415 215} type Select
}
}
}
}
Would generate:
#[derive(Debug, Clone, Default)]
pub struct UserInterface {
pub win: Window,
pub br: Browser,
}
impl UserInterface {
pub fn make_window() -> Self {
let mut win = Window::new(190, 213, 510, 360, None);
win.end();
win.make_resizable(true);
win.show();
let mut br = Browser::new(25, 25, 415, 215, None);
br.set_type(BrowserType::Select);
win.add(&br);
Self { win, br, ..Default::default() }
}
}
@MoAlyousef Got it. Thanks!
Reproduce steps:
SelectBrowser
.Expect:
SelectBrowser
.Actual:
HoldBrowser
andSelectBrowser
will be created asBrowser
.