-
Notifications
You must be signed in to change notification settings - Fork 648
Description
I believe, this was already indirectly mentioned in several other issues. Examples:
- Crash: tooltips cause an infinite loop #660
- I keep getting
nk_popup_close: Assertion 'popup->parent' failed.Aborted (core dumped)whenever I try using a popup, not sure why #683
There are multiple places in the library where, if you attempt to spawn another Popup, it will either trigger an assert or silently fail and do nothing. Examples:
Lines 29 to 31 in 171090c
| panel = win->layout; | |
| NK_ASSERT(!((int)panel->type & (int)NK_PANEL_SET_POPUP) && "popups are not allowed to have popups"); | |
| (void)panel; |
Lines 24 to 28 in 171090c
| /* make sure that no nonblocking popup is currently active */ | |
| win = ctx->current; | |
| in = &ctx->input; | |
| if (win->popup.win && ((int)win->popup.type & (int)NK_PANEL_SET_NONBLOCK)) | |
| return 0; |
This is quite annoying because few widgets use Popups under the hood (e.g. Menus) and so this limitation is not always clear.
Right now, it prevents creation of nested context menus, "cascading menus", stacked modals, and so on... For comparison, DearImGui does not have this problem.
Is there a specific reason why this limitation exists?
Are Popups implemented in a way, where supporting multiple of them would be a problem?
Thanks.