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??
Thanks very much for your reply! You've helped me get leaps and bounds beyond where I was before.

I've finally had a few moments to try to play with what you suggested, and so naturally I'm stuck again. :)

From what you described, I need to pre-define my labels so that I can just refresh the text that is being assigned to them. So far, good. Since this is a stock quote app that I'm writing, I've got a list of stocks I read out of a config file and save to a hash.

My thought was to do something along the lines of:

my %stocks = (^DJI =>{sec_label => $main->AddLabel( stuff...), current_label => #current price of stock, arrow_label => #direction of stock, change_label => #price change, pctchg_label => #percent change} )

and I'm building this dynamically since I may add or delete stocks at any time and that's working out perfectly.

What I'm getting stuck on is how to put parameters in the

$stocks{$key}{arrow_label}->Text( $var );
part where I'm just updating the text. In the arrow_label part of the hash, I want to be able to change the color to either red or green depending if a stock is going down or up respectively. Is there even a way to do that or am I stuck with just text?

Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

In reply to Re^2: Refreshing text without flicker with AddLabel using Win32::GUI by Popcorn Dave
in thread Refreshing text without flicker with AddLabel using Win32::GUI by Popcorn Dave

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2022-08-12 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?