fltk_builder/extensions/builder/
menu.rs1use fltk::{
2 enums::{Color, Font, FrameType},
3 prelude::MenuExt,
4};
5pub trait MenuBuilderExt {
7 fn with_text_font(self, c: Font) -> Self;
9 fn with_text_size(self, c: i32) -> Self;
11 fn with_text_color(self, c: Color) -> Self;
13 fn with_down_frame(self, f: FrameType) -> Self;
15}
16
17impl<M> MenuBuilderExt for M
18where
19 M: MenuExt,
20{
21 fn with_text_font(mut self, c: Font) -> Self {
22 self.set_text_font(c);
23 self
24 }
25
26 fn with_text_size(mut self, c: i32) -> Self {
27 self.set_text_size(c);
28 self
29 }
30
31 fn with_text_color(mut self, c: Color) -> Self {
32 self.set_text_color(c);
33 self
34 }
35
36 fn with_down_frame(mut self, f: FrameType) -> Self {
37 self.set_down_frame(f);
38 self
39 }
40}