You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
Goal: Since ImGui doesn't have a toolbar widget, I want to use a tab-bar instead in docked windows.
So I create a tab-bar (with no content) but when I set the ImGuiTabBarFlags_FittingPolicyScroll flag, the tab-bar scroll-buttons appear but don't work, so I can't get to the other buttons in the tab-bar.
Is this a bug, or else what am I doing wrong?
(see demo code below)
Thanks for any help and thanks for ImGui.
Regards
Screenshots/Video
// Demonstrate most Dear ImGui features (this is big function!)// You may execute this function to experiment with the UI and understand what it does.// You may then search for keywords in the code when you are interested by a specific feature.voidImGui::ShowDemoWindow(bool* p_open)
{
// test window
{
boolopen= false;
ImGui::Begin("test", &open);
static ImVector<int> active_tabs;
staticint next_tab_id = 0;
if (next_tab_id == 0) // Initialize with some default tabsfor (int i = 0; i < 10; i++)
active_tabs.push_back(next_tab_id++);
static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_FittingPolicyScroll;
if (ImGui::BeginTabBar("MyTabBar2", tab_bar_flags))
{
// Submit our regular tabsfor (int n = 0; n < active_tabs.Size; )
{
boolopen = true;
char name[16];
snprintf(name, IM_ARRAYSIZE(name), "%04d##test", active_tabs[n]);
ImGui::TabItemButton(name);
n++;
}
ImGui::EndTabBar();
}
ImGui::BeginChild("##");
ImGui::Text("this window does not belong to any tab!");
ImGui::EndChild();
ImGui::End();
}
// Exceptionally add an extra assert here for people confused about initial Dear ImGui setup// Most ImGui functions would normally just crash if the context is missing.
The text was updated successfully, but these errors were encountered:
The reason is that unlike tabs, those buttons are not selectable so there's no reference point to scroll to.
When you mix buttons and regular tabs, the buttons are skipped by those arrows.
So not have not doing anything wrong here and it's an interesting idea but right now it won't work. Using regular TabItem will work, you might alter their style so they don't look like tabs? By pushing PushStyleVar(ImGuiStyleVar_TabRounding, 0.0f); etc.
Version: latest
Branch: docking
Back-ends: glfw / allegro5
Compiler: g++
Operating System: ubuntu
My Issue/Question:
Hi all,
Goal: Since ImGui doesn't have a toolbar widget, I want to use a tab-bar instead in docked windows.
So I create a tab-bar (with no content) but when I set the ImGuiTabBarFlags_FittingPolicyScroll flag, the tab-bar scroll-buttons appear but don't work, so I can't get to the other buttons in the tab-bar.
Is this a bug, or else what am I doing wrong?
(see demo code below)
Thanks for any help and thanks for ImGui.
Regards
Screenshots/Video
The text was updated successfully, but these errors were encountered: