Tk.jl
Tk.jl copied to clipboard
Per-window management of resizing
Right now our resizing design is the following:
- window-resizing triggers canvas callbacks
- canvases are expected to call
Tk.update()when finished so that the results are rendered to the screen.
That means that if you resize a window that has 9 canvases in it, then you get---you guessed it---9 calls to Tk.update() for a single change in the window size. Not only does this hammer performance, but it leads to amusing but distracting tearing artifacts as canvases sequentially redraw.
We need to switch to a design that registers canvases with windows. Any issues with a synchronous approach? The idea would be that the window resize() function is the only one registered as a callback, and this function calls each canvas's .resize() and .draw() functions in a loop. At the end, there's a single call to Tk.update().