fltk_builder/extensions/builder/
group.rs1use fltk::prelude::{GroupExt, WidgetExt};
2
3pub trait GroupBuilderExt {
5 fn group(self, group: impl GroupExt) -> Self;
8 fn widget(self, widget: impl WidgetExt) -> Self;
10
11 fn as_resizeable(self, val: bool) -> Self;
14 fn with_clip_children(self, flag: bool) -> Self;
16}
17
18impl<G> GroupBuilderExt for G
19where
20 G: GroupExt,
21{
22 fn group(self, group: impl GroupExt) -> Self {
23 group.end();
24 self
25 }
26
27 fn widget(mut self, widget: impl WidgetExt) -> Self {
28 self.add(&widget);
29 self
30 }
31
32 fn as_resizeable(mut self, val: bool) -> Self {
33 self.make_resizable(val);
34 self
35 }
36
37 fn with_clip_children(mut self, flag: bool) -> Self {
38 self.set_clip_children(flag);
39 self
40 }
41}