Skip to content

Instantly share code, notes, and snippets.

@attilaz
Created March 3, 2015 12:20
Show Gist options
  • Save attilaz/db3b5357e650edd0d385 to your computer and use it in GitHub Desktop.
Save attilaz/db3b5357e650edd0d385 to your computer and use it in GitHub Desktop.
Listbox bugs
if (ImGui::CollapsingHeader("Horizontal Layout"))
{
// Text
ImGui::Text("Hello");
ImGui::SameLine();
ImGui::Text("World");
// Button
if (ImGui::Button("Banana")) printf("Pressed!\n");
ImGui::SameLine();
ImGui::Button("Apple");
ImGui::SameLine();
ImGui::Button("Corniflower");
// Button
ImGui::Text("Small buttons");
ImGui::SameLine();
ImGui::SmallButton("Like this one");
ImGui::SameLine();
ImGui::Text("can fit within a text block.");
// Checkbox
static bool c1=false,c2=false,c3=false,c4=false;
ImGui::Checkbox("My", &c1);
ImGui::SameLine();
ImGui::Checkbox("Tailor", &c2);
ImGui::SameLine();
ImGui::Checkbox("Is", &c3);
ImGui::SameLine();
ImGui::Checkbox("Rich", &c4);
// SliderFloat
static float f0=1.0f, f1=2.0f, f2=3.0f;
ImGui::PushItemWidth(80);
const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
static int item = -1;
ImGui::ListBox("Combo", &item, items, IM_ARRAYSIZE(items));
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Press Space to toggle");
ImGui::SameLine();
ImGui::SliderFloat("X", &f0, 0.0f,5.0f);
ImGui::SameLine();
ImGui::SliderFloat("Y", &f1, 0.0f,5.0f);
ImGui::SameLine();
ImGui::SliderFloat("Z", &f2, 0.0f,5.0f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment