Selectable Widgets
A selectable highlights when hovered, and can display another color when selected. Neighbors selectable extend their highlight bounds in order to leave no gap between them.Selectable
selected carries the selection state (read-only). Returns true when clicked.
const char*
Selectable label
bool
default:"false"
Current selection state (read-only)
ImGuiSelectableFlags
default:"0"
Selectable flags (see ImGuiSelectableFlags_)
const ImVec2&
default:"ImVec2(0, 0)"
Size (0.0f = use remaining width/height, >0.0f = specify)
bool
True when clicked (modify your selection state)
Selectable (pointer)
const char*
Selectable label
bool*
Pointer to selection state (read-write)
ImGuiSelectableFlags
default:"0"
Selectable flags
const ImVec2&
default:"ImVec2(0, 0)"
Size
bool
True when clicked
Multi-Selection
Multi-selection system forSelectable(), Checkbox(), TreeNode() functions. This enables standard multi-selection/range-selection idioms (Ctrl+Mouse/Keyboard, Shift+Mouse/Keyboard, etc.).
BeginMultiSelect
ImGuiMultiSelectFlags
Multi-select flags (see ImGuiMultiSelectFlags_)
int
default:"-1"
Current number of selected items (-1 if expensive to compute)
int
default:"-1"
Total number of items (-1 if expensive to compute)
ImGuiMultiSelectIO*
Multi-select I/O structure with requests to apply
EndMultiSelect
ImGuiMultiSelectIO*
Multi-select I/O structure with post-loop requests
SetNextItemSelectionUserData
ImGuiSelectionUserData
User data (typically item index)
IsItemToggledSelection
EndMultiSelect().
bool
True if item selection was toggled
Selectable Flags
ImGuiSelectableFlags_
Flags forSelectable().
Multi-Select Flags
ImGuiMultiSelectFlags_
Flags forBeginMultiSelect().
List Boxes
List boxes are thin wrappers aroundBeginChild() with the ImGuiChildFlags_FrameStyle flag.
BeginListBox
EndListBox() if BeginListBox() returns true.
const char*
List box label
const ImVec2&
default:"ImVec2(0, 0)"
Size (0 = default size)
bool
True if list box is open
EndListBox
BeginListBox() returned true.
ListBox (simple)
const char*
List box label
int*
Pointer to current selected item index
const char* const[]
Array of item strings
int
Number of items in array
int
default:"-1"
Height in number of items (-1 = default ~7)
bool
True when selection has been modified
ListBox (callback)
const char*
List box label
int*
Pointer to current selected item index
const char* (*)(void*, int)
Callback function to get item string
void*
User data passed to callback
int
Number of items
int
default:"-1"
Height in number of items
bool
True when selection has been modified