use crate::{ItemFlagStackToken, ItemFlags, Ui};
pub type ButtonRepeatToken<'ui> = ItemFlagStackToken<'ui>;
impl Ui {
#[doc(alias = "PushButtonRepeat")]
pub fn push_button_repeat(&self, repeat: bool) -> ButtonRepeatToken<'_> {
self.push_item_flag(ItemFlags::BUTTON_REPEAT, repeat)
}
#[doc(alias = "PushButtonRepeat", alias = "PopButtonRepeat")]
pub fn with_button_repeat<R>(&self, repeat: bool, f: impl FnOnce() -> R) -> R {
let repeat = self.push_button_repeat(repeat);
let result = f();
drop(repeat);
result
}
}