Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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?

In reply to Dynamic re-pack widget by Phinix

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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 imbibing at the Monastery: (5)
    As of 2014-08-21 09:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (129 votes), past polls