mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 22:48:34 +00:00
Expose parameters to igSelectable.
This commit is contained in:
parent
73abfc21b4
commit
27bbe10107
@ -354,7 +354,7 @@ fn show_test_window<'a>(ui: &Ui<'a>, state: &mut State, opened: &mut bool) {
|
|||||||
ui.text(im_str!("Aquarium"));
|
ui.text(im_str!("Aquarium"));
|
||||||
ui.separator();
|
ui.separator();
|
||||||
for (index, name) in names.iter().enumerate() {
|
for (index, name) in names.iter().enumerate() {
|
||||||
if ui.selectable(name.clone()) {
|
if ui.selectable(name.clone(), false, ImGuiSelectableFlags::empty(), ImVec2::new(0.0, 0.0)) {
|
||||||
state.selected_fish = Some(index);
|
state.selected_fish = Some(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -552,8 +552,9 @@ impl<'ui> Ui<'ui> {
|
|||||||
|
|
||||||
// Widgets: Selectable / Lists
|
// Widgets: Selectable / Lists
|
||||||
impl<'ui> Ui<'ui> {
|
impl<'ui> Ui<'ui> {
|
||||||
pub fn selectable<'p>(&self, label: ImStr<'p>) -> bool {
|
pub fn selectable<'p>(&self, label: ImStr<'p>, selected: bool, flags: ImGuiSelectableFlags,
|
||||||
unsafe { imgui_sys::igSelectable(label.as_ptr(), false, ImGuiSelectableFlags::empty(), ImVec2::new(0.0,0.0)) }
|
size: ImVec2) -> bool {
|
||||||
|
unsafe { imgui_sys::igSelectable(label.as_ptr(), selected, flags, size) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user