Skip to content
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

Tabs #1928

Closed
kenkit opened this issue Jul 5, 2018 · 6 comments
Closed

Tabs #1928

kenkit opened this issue Jul 5, 2018 · 6 comments
Labels
tabs tab bars, tabs

Comments

@kenkit
Copy link

kenkit commented Jul 5, 2018

Hi how do I add tabs, I don't see any example on how to do that. I tried using this https://github.com/scottmudge/imgui_tabs but it seems the code is old so it doesn't work.
I need something like
687474703a2f2f692e696d6775722e636f6d2f3650534b394e4c2e676966

I hope you will bear with my too many questions. I just want to make something really great.

@sonoro1234
Copy link

sonoro1234 commented Jul 5, 2018

Tabs are not part of base imgui (this repo) but can be emulated as with this Lua code
in which tabed_dialogs is a table of dialogs (basically an object whith a name and a function for drawing things) and curr_dial is a variable to hold which is the current dialog.

for i,v in ipairs(tabed_dialogs) do
    local dopop = false
    if i == curr_dial then
        ig.PushStyleColor(imgui.ImGuiCol_Button, ig.ImVec4(1,0,0,1))
        dopop = true
   end
   if (ig.Button(v.name)) then curr_dial = i end
   if dopop then ig.PopStyleColor(1); end
   ig.SameLine(0,1)
end

imgui.igSeparator();
tabed_dialogs[curr_dial]:draw()

tab

Also see #261
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
Or you can wait until the tabs branch is merged.

@kenkit
Copy link
Author

kenkit commented Jul 5, 2018

Nice I think i'll find something usefull in there.
Thank you

@kenkit kenkit closed this as completed Jul 5, 2018
@ocornut
Copy link
Owner

ocornut commented Jul 6, 2018

There's a "Tabs" branch with an old take on this feature.
I'm working on a V2 right now (V2 of tabs and V2 of docking) and hopefully Tabs will make it to master sooner.

@kenkit
Copy link
Author

kenkit commented Jul 6, 2018

I found a working copy https://trello.com/c/ihjVWcju There are screenshots in there.

@kenkit
Copy link
Author

kenkit commented Jul 6, 2018

@sonoro1234 Did a good job linking me to that other branch, since I've just discovered a whole lot of new features.
Thanks guys

@ebachard
Copy link

@kenkit : sorry I missed the issue. Just in case you are still interested, I forked Scott Mudge work some time ago, but I'm unsure he added my changes (PR in progress). If you want to give it a try, everything is here : https://github.com/ebachard/imgui_tabs (I just resync'ed today, and it should just build with the current 1.63 WIP of Dear ImGui).

Last but not least, if you see problems, don't hesitate to file an issue.

Thanks,
ericb

@ocornut ocornut added the tabs tab bars, tabs label Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tabs tab bars, tabs
Projects
None yet
Development

No branches or pull requests

4 participants