-
-
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
ImGuiTabItemFlags_SetSelected only affects the next frame, always renders first tab once. #6681
Comments
The problem is most likely that your first tab is open when it is committed (ImGui doesn't know about the third one ahead of time), gets its items committed and then you switch to the third tab when you send that one for the first time. Take a look at |
It's not possible via this exact Internally we have a |
Yes, simply specifying the tab index ahead of submitting them is the kind of API I was wanting all along :) |
It wouldn’t be by index but by identifier and needs to work before the first creation of the tab. Are you always selecting the third tab or are you actually attempting to save/restore tab-bar state in eg the ini file? |
Identifier would work too. I am currently always selecting a fixed tab on startup. This is the "help" tab so while it should be shown the first time, I want it to be the last tab in normal usage (otherwise making it the first tab would have been an easy solution). |
I have pushed a variant of |
My Issue/Question:
ImGuiTabItemFlags_SetSelected on a tab doesn't apply to the frame it is specified on, but gets Q-ed up for the next one.
When my app starts, I am trying to show tab 3, but instead it flashes tab 1 for 1 frame, which is very visible because these tabs may contained color images. It looks a bit like a "rendering glitch".
It's super minor, and completely understandable way to implement tab selection, but if at all possible, switching to the tab on the frame it is requested would result in a more slick looking UI, especially in cases where the tabs come into view as a consequence of wanting to show a tab that's not the first one.
Or, maybe there is a way to force the active tab before they come into view?
The text was updated successfully, but these errors were encountered: