Skip to content

Instantly share code, notes, and snippets.

@dougbinks
Created October 30, 2015 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dougbinks/cec967aefc739b8c0333 to your computer and use it in GitHub Desktop.
Save dougbinks/cec967aefc739b8c0333 to your computer and use it in GitHub Desktop.
ImGui MenuItemCheckbox
bool MenuItemCheckbox( const char* name_, bool* pB_ )
{
bool retval = ImGui::MenuItem( name_ );
ImGui::SameLine();
if( *pB_ )
{
ImGui::Text(ICON_FA_CHECK_SQUARE_O);
}
else
{
ImGui::Text(ICON_FA_SQUARE_O);
}
if( retval )
{
*pB_ = ! *pB_;
}
return retval;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment