Skip to content

Commit 214a60a

Browse files
committed
impl enable(), disable() for all controls
1 parent 13fd812 commit 214a60a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

iui/src/controls/create_macro.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ macro_rules! define_control {
5555
unsafe { ui_sys::uiControlHide(control.ui_control) }
5656
}
5757

58+
// Enable this control.
59+
pub fn enable(&mut self, _ctx: &UI) {
60+
let control: Control = self.clone().into();
61+
unsafe { ui_sys::uiControlEnable(control.ui_control) }
62+
}
63+
64+
// Disable this control.
65+
pub fn disable(&mut self, _ctx: &UI) {
66+
let control: Control = self.clone().into();
67+
unsafe { ui_sys::uiControlDisable(control.ui_control) }
68+
}
69+
5870
/// Create an `iui` struct for this control from the raw pointer for it.
5971
///
6072
/// # Unsafety

0 commit comments

Comments
 (0)