in reply to Re: Simple PerlTk program working slow
in thread Simple PerlTk program working slow

Sorry I didn't give enough details about the issue. Really program starts and runs fast. You can scroll down with mouse wheel. It works fine.

The problem appears when I change main window size by dragging main window border with mouse. It issues 'Configure' event that is bound to a anonymous subroutine that just calls update_fileview() subroutine. This subroutine redraws canvas with rectangles.

I must note that in TCL version 'Configure' event is bound on canvas widget and it works rather fine. In Perl when I bind 'Configure' event on canvas it doesn't call the bound subroutine when I change toplevel window size. So I decided to bind 'Configure' event on $top (toplevel) widget, that is a parent of canvas $canv. And it works as expected but redrawing during window resize is very slow.

Now I know that the slowness is caused by binding to a toplevel ($top) widget instead of canvas ($canv). When I changed binding in TCL from canvas to toplevel ('.') it has shown the same issue.

So by now I only try to figure out how to force 'Configure' event to come to canvas. Current binding only works for toplevel, that, as we know, shows very slow redraw issue. The main question - how to make canvas to receive 'Configure' event??

  • Comment on Re^2: Simple PerlTk program working slow