|Pathologically Eclectic Rubbish Lister|
Dynamic re-pack widgetby Phinix (Acolyte)
|on Dec 05, 2012 at 17:50 UTC||Need Help??|
Phinix has asked for the
wisdom of the Perl Monks concerning the following question:
Happy holidays, monks and monkettes!
I am working on a new project and ran into a bit of a snag, again. This time, I have a bunch of Scale (slider) widgets lined up vertically next to each other. At the top of each slider bar I have the label super-imposed on the bar as an image of some text I rotated 90 degrees counter clockwise for each.
In order to have this label not obscure the slider grab-thingy I have written a simple little subroutine. When the slider reaches a certain height on a given bar (depending on how long the text label is, the label will snap to below it using the form() manager to relocate the associated image, and move with it using a constant re-position routing in the slider's command subroutine.
This works perfectly when moving sliders.
The problem I am having is getting the position of slider labels to update when I change their variables from another section. I want the command associated with each slider to still run and move the label out of the way when it does even if I don't slide them by hand.
In the past I have had no problem getting widgets to update through other functions, either by changing their variables directly, running subs, using update, or sometimes configure(). None of these methods are working this time, so I am wondering what is the best way to scoot stuff around.
Would forgetting the images before re-forming them make any difference? The sliders do actually move, however the command associated with them appears to not run unless you physically move them by hand.So, my question is how do you get a slider's command to run even when it is not being moved by hand (other function alters its variable, etc.) Or, how can I use the form() geometry manager to dynamically adjust the position of a widget currently off-screen and have it update reliably?