Skip to content

Instantly share code, notes, and snippets.

@attilaz
Created March 2, 2015 14:35
Show Gist options
  • Save attilaz/04beb4319061b371fd32 to your computer and use it in GitHub Desktop.
Save attilaz/04beb4319061b371fd32 to your computer and use it in GitHub Desktop.
combo horizontal layout bug
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", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK" };
static int item2 = -1;
ImGui::Combo("combo scroll", &item2, items, IM_ARRAYSIZE(items));
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