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??


In reply to Re^2: Simple PerlTk program working slow by dexahex
in thread Simple PerlTk program working slow by dexahex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.