vurtun / nuklear

A single-header ANSI C gui library
13.68k stars 1.11k forks source link

Issue With Closing Window in Node Editor #869

Open ethanccs opened 5 years ago

ethanccs commented 5 years ago

Edit the node editor demo to change line:

if (nk_group_begin(ctx, it->name, NK_WINDOW_MOVABLE|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER|NK_WINDOW_TITLE))

to

if (nk_group_begin(ctx, it->name, NK_WINDOW_MOVABLE|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER|NK_WINDOW_TITLE|NK_WINDOW_CLOSABLE))

This makes the windows closable inside of the node editor. However, when the window inside of the node editor is closed, an assertion fails (line 17538) : nk_panel_layout: Assertion `!(layout->flags & NK_WINDOW_HIDDEN)'

This has the comment that the code should not raise it if it is an if(nk_begin) segment. It is in a begin segment however, and the assertion is still raised. Unless there is something that I think this is a bug.

dumblob commented 5 years ago

Well, I would guess the if( nk_begin )... comment relates to general use of groups and windows, but in this case of closing/hiding I'm not sure if it's the only reason. Closing a "window" in Nuklear doesn't work internally as intuitively as one would expect judging by the name. Search for "closing" or similar in this Nuklear issue tracker to find out more as I think there were some other similar issues lately.