Creating and adding a second Window with Dim objects - doesn't show until resize
See original GitHub issueA have a main Window
added to Application.Top
, and a TableView
added to it. The table has a CellActivated
event which creates a new Window
, also added to Application.Top
.
If I set the Width
and Height
of the new window to anything calculated, e.g. Dim.Fill()
, it will not show on the screen until I resize the terminal. Keypresses, table item selection etc work as normal, and the new window does not show.
If I set the dimensions of the new window to anything constant, e.g. 20
each, it will show immediately.
Putting the Dim.Fill()
-ed window creation in a timeout or main-thread invoke do not fix the situation.
Edit
It works if I parent the new Window
to the existing one. I wondered if it could be a Z-order issue, but when I shrunk the first window and had the second one larger, it didn’t show until resize, either
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top GitHub Comments
No problem.
To maintain the menu and status bar always visible in the application, you need to add the views to a
Window
and then add it to theApplication.Top
, or add the views to aToplevel
and then add it to theApplication.Top
.Yes, is a limitation of the
WindowsConsole
, which returns always the same height on shrinking, causing the menu or the status bar not visible on scrolling.Not sure why I deleted the comment, gut reaction when I got it working I suppose. Sorry about that @BDisp. 🤦♂️
I restructured from
Application
->Window
->View
toApplication
->TopLevel
->Window
->View
(where theView
is removed/replaced from/to theWindow
) and now it works as expected. Can probably chalk it up to unfamiliarity with the library. That said, if there’s a better way to structure things, I’m all ears.The issue with the Windows Console breaking reflow when resized vertically remains, but I’d hazard that’s more a limitation of the Windows Console than the library.