Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

imgui_command_palette (C++)

ImGui Command Palette: a command palette, as in Sublime Text or VS Code: the user types to find and run the app’s commands.

The C++ API of ImGui Command Palette as it is bound to Python: the entries of the module imgui_bundle.imgui_command_palette, in the same order, with their C++ signatures and the headers’ comments. From the stubs: the functions excluded from the bindings, the typedefs and the macros are absent.

imcmd_command_palette.h

TODO support std::string_view

TODO support function pointer callback in addition to std::function

ImCmdTextType (enum)

MemberValue
ImCmdTextType_Regular0
ImCmdTextType_Highlight1
ImCmdTextType_COUNT, }2

ImCmdTextFlag (enum)

MemberValue
ImCmdTextFlag_Underline0
ImCmdTextFlag_COUNT, }1

Command (struct)

Member
std::string Name;
std::function<void()> InitialCallback;
std::function<void(int selected_option)> SubsequentCallback;
std::function<void()> TerminatingCallback;

Command management

ImCmd::AddCommand

void AddCommand(Command command);

ImCmd::RemoveCommand

void RemoveCommand(const char* name);

Styling

ImCmd::GetStyleFlag

bool GetStyleFlag(ImCmdTextType type, ImCmdTextFlag flag);

ImCmd::SetStyleFlag

void SetStyleFlag(ImCmdTextType type, ImCmdTextFlag flag, bool enabled);

ImCmd::GetStyleFont

ImFont* GetStyleFont(ImCmdTextType type);

ImCmd::SetStyleFont

void SetStyleFont(ImCmdTextType type, ImFont* font);

ImCmd::GetStyleColor

ImU32 GetStyleColor(ImCmdTextType type);

ImCmd::SetStyleColor

void SetStyleColor(ImCmdTextType type, ImU32 color);

ImCmd::ClearStyleColor

void ClearStyleColor(ImCmdTextType type);

< Clear the style color for the given type, defaulting to ImGuiCol_Text

Command palette widget

ImCmd::SetNextCommandPaletteSearch

void SetNextCommandPaletteSearch(const char* text);

ImCmd::SetNextCommandPaletteSearchBoxFocused

void SetNextCommandPaletteSearchBoxFocused();

ImCmd::CommandPalette

void CommandPalette(const char* name);

ImCmd::IsAnyItemSelected

bool IsAnyItemSelected();

ImCmd::RemoveCache

void RemoveCache(const char* name);

ImCmd::RemoveAllCaches

void RemoveAllCaches();

Command palette widget in a window helper

ImCmd::SetNextWindowAffixedTop

void SetNextWindowAffixedTop(ImGuiCond cond = 0);

ImCmd::CommandPaletteWindow

void CommandPaletteWindow(const char* name, bool* p_open);

ImCmd::Prompt

void Prompt(std::vector<std::string> options);

Command responses, only call these in command callbacks (except TerminatingCallback)

imgui-command-palette-py-wrapper.h

ContextWrapper (struct)

ContextWrapper::ContextWrapper
inline ContextWrapper();