-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select default tab not working #7835
Comments
If i may suggest, your code also seems a little error-prone. You could probably simplify it by storing a single (We should eventually support auto-saving of selected tab in standalone tab-bar.) |
Apart from the solution of using |
Ahhh ok, your second suggestion solved it for me perfectly. Thanks! "If i may suggest, your code also seems a little error-pron" - yeah I wasn't happy with the code, I was just struggling to anything working haha. All of that code went away and I'm just storing an index. Thanks for the help |
Good to hear. Closing now. I will post here again if we end up adding .ini support for standalone tab-bars. |
Version/Branch of Dear ImGui:
v1.90.9
Back-ends:
imgui_impl_dx11.cpp
Compiler, OS:
Windows 10
Full config/build information:
No response
Details:
I'm writing a program where I can serialize/deserialize data.
One piece of data that I'm saving/loading is which tab was last selected, so that when I load the program, it selects the tab I was last on.
I'm using the flag ImGuiTabItemFlags_SetSelected which almost works but is doing something weird.
More Context:
I'm writing a budgeting program where I have tabs from Jan - Dec to select from. By selecting a Tab, it simply sets the appropriate index for me to use for other parts of the code. I have an array[12] of flags for each Tab so it has its own flag to use so that I can set different tabs with flags of either ImGuiTabItemFlags_SetSelected or ImGuiTabItemFlags_None.
If I default my tab to lets say May, that works. And then if I click on April (one tab left), that works as well in setting the previous tabs flag (May) to None and the new tab (April) to Selected. But if I try and go to any tab to the right, it switches for a frame and then switches back. (So I can only move tabs left essentially, due to order of operations)
When I step through the program, it looks like even though I'm passing in ImGuiTabItemFlags_None into the tab that I'm switching away from (so in this case switching away from April and moving to May), it still evaluates to true, overwriting my selection.
I'm not clear on why or how this tab is evaluating to True even though I'm passing it ImGuiTabItemFlags_None.
I can provide any and all information.
I was having trouble getting a video less than 10mb's on file size which is a the limit. But if it becomes imperative that I provide more, I can try again.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: