dear_imgui_rs/widget/misc/
basic.rs1use crate::Ui;
2use crate::sys;
3
4impl Ui {
5 #[doc(alias = "Bullet")]
7 pub fn bullet(&self) {
8 self.run_with_bound_context(|| unsafe {
9 sys::igBullet();
10 });
11 }
12
13 #[doc(alias = "BulletText")]
15 pub fn bullet_text(&self, text: impl AsRef<str>) {
16 let text_ptr = self.scratch_txt(text);
17 self.run_with_bound_context(|| unsafe {
18 const FMT: &[u8; 3] = b"%s\0";
20 sys::igBulletText(FMT.as_ptr() as *const std::os::raw::c_char, text_ptr);
21 });
22 }
23}
24
25impl Ui {
26 #[doc(alias = "SmallButton")]
28 pub fn small_button(&self, label: impl AsRef<str>) -> bool {
29 let label_ptr = self.scratch_txt(label);
30 self.run_with_bound_context(|| unsafe { sys::igSmallButton(label_ptr) })
31 }
32}