Jump to content
Sign in to follow this  
aommaster

Updating a Label

Recommended Posts

aommaster

Hi guys!

I'm currently trying to make a GUI (just for the heck of it, I'm trying to learn how to use Autoit).

I have a GUI that has certain labels (e.g. "Total profit is: $xxx"). The xxx is calculated from the Listview that is also there in the GUI (and if you want to know, the Listview is populated from a text file... yes, I got that far :))

Now, I have also created functions where you can add and remove items from the listview (Adding items requires input into some fields, which are also there in the GUI). As a side note, I also managed to get the GUI to update the text file when a certain element is removed or added.

However, I cannot get the labels to actually change so that the new profit (let's say that I made a mistake and want to change my entry. I would delete my entry and re-type it in). The GUI is only updated once the GUI is turned off and back on (this is expected). Is there a way of acutally making it update as an item is added to the listview?

Thanks guys!

Share this post


Link to post
Share on other sites
Achilles

Hi guys!

I'm currently trying to make a GUI (just for the heck of it, I'm trying to learn how to use Autoit).

I have a GUI that has certain labels (e.g. "Total profit is: $xxx"). The xxx is calculated from the Listview that is also there in the GUI (and if you want to know, the Listview is populated from a text file... yes, I got that far :))

Now, I have also created functions where you can add and remove items from the listview (Adding items requires input into some fields, which are also there in the GUI). As a side note, I also managed to get the GUI to update the text file when a certain element is removed or added.

However, I cannot get the labels to actually change so that the new profit (let's say that I made a mistake and want to change my entry. I would delete my entry and re-type it in). The GUI is only updated once the GUI is turned off and back on (this is expected). Is there a way of acutally making it update as an item is added to the listview?

Thanks guys!

Try GuiCtrlSetData()

GuiCreate('Testing', 120, 80) 


$label = GuictrlCreateLabel('More testing...', 10, 10, 100, 20) 

$button = GuictrlCreateButton('Update Label', 10, 40, 100, 25) 

GuiSetState() 

While 1 
    Switch GuiGetMsg() 
        case - 3 
            Exit 
        Case $button 
            GuiCtrlSetdata($label, 'IT CHANGED!!!') 
    EndSwitch 
    
WEnd

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
aommaster

...and why didn't I think of that?

Thanks so much! It works perfectly!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.