in reply to Re: Refreshing text without flicker with AddLabel using Win32::GUI
in thread Refreshing text without flicker with AddLabel using Win32::GUI
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
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?$stocks{$key}{arrow_label}->Text( $var );