kotlin-graphics / imgui

Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
MIT License
605 stars 36 forks source link

hmm how to use beginChildEx properly. #146

Closed gurachan closed 4 years ago

gurachan commented 4 years ago
imgui.beginChildEx("Hewwo", 0, new Vec2(200,300), false, 0);
imgui.endChild();

well, I will use this as another new window beside my imgui.begin one. but the title doesn't really work.. everything works besides title I don't want a debug title on my window. also how to make that close button appear on beginchild. as a default on begin the close button is there.. also X button is not even listed in the flag. might be good if it's listed as a flag WindowFlag.NoClose something.

so another window looks like this

image

in the c++ version their beginechild ex looks like this

ImGui::BeginChild("scrolling");
ImGui::SetScrollX(ImGui::GetScrollX() + scroll_x_delta);
ImGui::EndChild();

I'm just using c++ docs and trying to make sense on the kotlin/java one hahaha help.

image

it does say name. is that not title of the child?

As alternative i tried popup but it only works on fresh open. next click it wont open any more..

if (imgui.begin("AAAAAA AAAAAAAAAA AAAAAAAAA", null, 0, WindowFlag.AlwaysAutoResize.i + WindowFlag.NoResize.i)) {
            imgui.text("AAAAAAA AAAAAAA: AAAAAAAA");
            imgui.spacing();
            if (imgui.collapsingHeader("AAAAAA AAAAAAA", 0)) {
                imgui.spacing();
                imgui.text("AAAAAA AAAAAAAA: AAAAAAA");
                if (imgui.button("Open Me", new Vec2(60, 20))) {
                    imgui.openPopup("hello");
                }

                if (imgui.beginPopupModal("hello", open, WindowFlag.AlwaysAutoResize.i)) {
                    imgui.text("im a text lol");
                    imgui.spacing();
                    imgui.endPopup();
                } 
            }
        }

the idea of it I get in here.

https://github.com/ocornut/imgui/blob/7b0570d6bac96ed64d379d240907f8fee319d57b/imgui_demo.cpp#L2993-L3017 image

elect86 commented 4 years ago

May I ask why you closed this?

I was going to look at it in the next days..

gurachan commented 4 years ago

May I ask why you closed this?

I was going to look at it in the next days..

because I thought this is how to make a new window. I find that making new begin and end begin is what I really looking for. .. for making a new another or multiple window. using this beginChildEx is blocking all input on another window.. which is not what I'm looking for. its a mistake on my end.

but you know what, I still like to know how beginChildEx works. I can't change its title. It blocking input on parent window.. what is really used for. it's like a modal or something. I don't even know how to make the close button appear or how to close it.