question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating and adding a second Window with Dim objects - doesn't show until resize

See original GitHub issue

A 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:closed
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
BDispcommented, Aug 13, 2021

Not sure why I deleted the comment, gut reaction when I got it working I suppose. Sorry about that @BDisp. 🤦‍♂️

No problem.

I restructured from Application -> Window -> View to Application -> TopLevel -> Window -> View (where the View is removed/replaced from/to the Window) 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.

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 the Application.Top, or add the views to a Toplevel and then add it to the Application.Top.

The issue with the WindowsConsole breaking reflow when resized vertically remains, but I’d hazard that’s more a limitation of the Windows Console than the library.

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.

1reaction
tim-elmercommented, Aug 13, 2021

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 to Application -> TopLevel -> Window -> View (where the View is removed/replaced from/to the Window) 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JPanel doesn't update until resize Jframe
I subclass JPanel to overwrite paintComponent(Graphics), I want to draw an image onto jpanel in a jframe. But my image hasn't shown up...
Read more >
ResizeObserver: it's like document.onresize for elements
The callback is passed an array of ResizeObserverEntry objects—one entry per observed element—which contains the new dimensions for the element.
Read more >
Resizing Objects - NI
To resize an object as you add it to the front panel, click to place the object, hold the mouse button down, and...
Read more >
Wezterm does not always notice window resize · Issue #1992
I tested this scenario with git bisect: create new wezterm window (my default is approximately full screen); open launcher, verify it looks good ......
Read more >
Window guide
A window and its OpenGL or OpenGL ES context are created with glfwCreateWindow, which returns a handle to the created window object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found