Closed antongit closed 1 year ago
Hmm not sure, it doesn't feel intuitive yet. The naming is hard to grasp.
Is Open: Channel<bool>
I'd suggest Is Collapsed: Channel<bool>
Has Close Button: bool
I'd suggest Closing: Channel<Unit>
- if provided the Close button is visible and if clicked will push into that channel. That should allow to build logic like a "Save Dialog" before the actual window is being setup. Didn't try it yet, but at least the information would be upstream and not below.I've opened a branch with the two changes suggested above https://github.com/vvvv/VL.ImGui/tree/feature/window-with-closing-input
After checking the Issue with @azeno we came to conclusion:
IsVisible
and IsOpen
(maybe differently named) pins as CollapsingHeader. And Window should also disappear if IsVisible false.Current state of the Pins:
Window
CollapsingHeader, TreeNode
Popup
Popup (Modal)
TabItem
After the call with @azeno and @gregsn it looks like, that we've finally got it with the pin names:
Additional unrelated issue:
Open
when it is not collapsed or clipped.Visible
when it is displayed.To actually create a window on the screen (to display it), we just enable an
If
region with the Window inside. The Window hasIsVisible
output pin that turns false when theClose
button on the titlebar is clicked.Here how ImGui defines it: https://github.com/ocornut/imgui/blob/5bb287494096461f90eb5d18135f7c4809efd2f5/imgui.h#L318
To Open / Close (display / discard) a window the patch looks like that:
HowTo Open And Close a Window.zip
Is it ok like that? @azeno , @gregsn What do think?