Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: Tk::grid -sticky option not stretching frames

by boleary (Beadle)
on Nov 15, 2018 at 02:27 UTC ( #1225832=note: print w/replies, xml ) Need Help??


in reply to Re^5: Tk::grid -sticky option not stretching frames
in thread Tk::grid -sticky option not stretching frames

that's pretty cool, I will take a look in depth at it... One thing I will try... I will add 1000 OptionMenus to your canvas in place of those rectangles and see how much longer it takes to build :)

Thanks for all your insight... I have used many of your posts in the past to find solutions to my Tk problems and I really appreciate it.

Hopefully I'll get to the point where I can provide the same kind of help every now and again

  • Comment on Re^6: Tk::grid -sticky option not stretching frames

Replies are listed 'Best First'.
Re^7: Tk::grid -sticky option not stretching frames
by zentara (Archbishop) on Nov 15, 2018 at 13:19 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1225832]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2019-12-09 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?