tview icon indicating copy to clipboard operation
tview copied to clipboard

Add window size change handler

Open tslocum opened this issue 6 years ago • 2 comments

My thanks to the tcell & tview contributors! The migration has been a pleasure.

tslocum avatar Oct 14 '19 22:10 tslocum

I'm generally ok with this but I wonder why we need to supply the callback with the Screen object? This is likely not the right time for a client to draw something onto the screen. (The documentation also does not say what state the screen is in. Has it already been redrawn? Or will it be redrawn after the callback is invoked?) For redraw events, there is SetBeforeDrawFunc and SetAfterDrawFunc().

If information such as the new size of the screen is needed, we should provide that directly instead.

What do you think?

rivo avatar Jan 08 '20 16:01 rivo

Thanks. I agree that providing width/height directly is best. I've updated this PR with that change as well as clarifying that the screen is cleared and the application is redrawn after invoking this callback.

tslocum avatar Jan 16 '20 13:01 tslocum