Flix01 / imgui

Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
MIT License
396 stars 34 forks source link

Filesystem filenames are duplicated, along with Filesystem GUI windows #25

Closed fuchstraumer closed 6 years ago

fuchstraumer commented 6 years ago

Source code implementing this can be found here: https://gist.github.com/fuchstraumer/4c7dd38f9ae620b0b8fcc622b4df1c8b

Examples of the bug: bug0 bug1 bug2

The weird behavior is that when the window is dragged such that it gets split in two, the duplicated folders and filenames disappear. But if I expand the window back out, the duplicates are back.

The duplicates can't be clicked, including the duplicated window elements below the list of files and folders. This is really quite odd, and I peered around in the code to try to find out why its happening to no avail.

Flix01 commented 6 years ago

You can't define a single static ImGuiFs::Dialog fileDialog; and then reuse it many times (in the same frame). That means also that you can't turn a chooseFileDialog into a saveFileDialog, as you are doing.

Each instance brings along a lot of state paramenters, and even if only one is open, you cannot present the same instance twice in a frame.

This is probably what it's happening here... Please see the code in examples/addons_examples/main.cpp: there are many instances that are used together in the correct way.