gobsor Posted August 10, 2010 Posted August 10, 2010 Hey its me again! Got another problem, I'm pretty sure that's been asked before, but I couldn't find any example on how to do that, even though it got to be really easy! I want a simple GUI with an Input and a Label on it, not a problem so far. But now I want the Label to read the text that is entered in the Input. So, how do I update the Label with the Input's text? Gotta be some kind of while, I tried it like the following: GUI/LABEL/INPUT CODE GOES HERE [...] While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop GUICtrlSetData($streetlabel, GUICtrlRead($streetdate)) GUICtrlSetData($riplabel, GUICtrlRead($ripdate)) Sleep(200) WEnd This kinda works but is very, very unsexy. The Label field is fluttering and one definetly feels the 200ms delay sometimes when typing. Is there any better solution? Regards
PsaltyDS Posted August 10, 2010 Posted August 10, 2010 (edited) You are constantly updating the label, even when it already contains the right data. Change your loop to check it first and only update if required. If GuiCtrlRead($streetlabel) <> GuiCtrlRead($streetdate) Then GUICtrlSetData($streetlabel, GUICtrlRead($streetdate)) Edited August 10, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
gobsor Posted August 11, 2010 Author Posted August 11, 2010 Thanks a lot! I'm new to programming at all that's why I stuck at 'easy parts' pretty often, your solution is just perfect! Regards
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now