Popup Levels and How They Work #3773
Replies: 4 comments 3 replies
-
A popup stack is maintained, it tracks nested popups. Also calling |
Beta Was this translation helpful? Give feedback.
-
+1 to everything Rokups said. Use the |
Beta Was this translation helpful? Give feedback.
-
So my problem isn't that things are unable to close (everything that I want to close does so). I'm using a relatively class based system where each class (in this case, they're all windows) has a |
Beta Was this translation helpful? Give feedback.
-
ImGui functions operate on ID stack. Calling it somewhere in a constructor
most likely calls it outside render poop, with no active window and no ID
stack. I am surprised you didn't get an assert. See
https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-why-is-my-widget-not-reacting-when-i-click-on-it
…On February 2, 2021 20:06:52 PSMusicalRoc ***@***.***> wrote:
So my problem isn't that things are unable to close (everything that I want
to close does so). I'm using a relatively class based system where each
class (in this case, they're all windows) has a perframe function that
basically renders the windows through ImGui. I then have a std::vector that
keeps track of these windows and renders them each frame. If their
&isVisible boolean is false, it destroys the object. I have a Modal class
(that being the example code), and before coming to this, I tried calling
OpenPopup in the constructor of the class, and ClosePopup in the
destructor. The destructor code worked (and still works), but calling
OpenPopup never did until it was in the update loop. Why is that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
So I've been messing around with Popups, more specifically Modals, and was confused by a concept called a "PopupLevel." My question is what are PopupLevels and why does this work:
...but not this:
(For reference, in both examples, this function is the update function for a window class. Each class has a
bool isVisible
that dictates whether or not the window is shown. If it's not visible, the destructor, which containsCloseCurrentPopup()
, is called.)Beta Was this translation helpful? Give feedback.
All reactions