Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi, I'm glad I could help you. To go further, in my previous reply I suggested for responsiveness, try to stick to one widget, like the canvas. If you go and try to add 1000 OptionMenus to the Canvas, it will quite possibly slow things up, because all those extra widgets need event handling. There is a good solution though, by popping up toplevel windows to handle your OptionMenus. So in the example I gave, you would add a right-click binding to each active area, when the right-click is processed, it pops open a separate toplevel window containing your OptionMenu. You load the OptionMenu dynamically from a big hash of data. Then REUSE the OptionMenu by deleting all it's current options, and reloading it when it needs to be used again. So, the overall idea is to make a single reusable toplevel window ( or popup ), with a single reusable OptionMenu, which you dynamically reconfigure with appropriate data on each use. This way, you stay responsive, AND MORE IMPORTANTLY, you don't start getting unwanted memory gains from repeated toplevel creations. Always think in terms of reusing widgets if possible, as that keeps the memory footprint under control.

As a quick example, here is a reusable toplevel that you could use. See Re: opening multiple sub-windows in perl tk


I'm not really a human, but I play one on earth. ..... an animated JAPH

In reply to Re^7: Tk::grid -sticky option not stretching frames by zentara
in thread Tk::grid -sticky option not stretching frames by boleary

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (6)
    As of 2019-11-13 20:36 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Strict and warnings: which comes first?



      Results (74 votes). Check out past polls.

      Notices?