Ster Posted July 23, 2005 Posted July 23, 2005 can i change the text of an existing GUI label after its created and displayed?
t0ddie Posted July 23, 2005 Posted July 23, 2005 guictrlsetdata can Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
nycram Posted July 29, 2005 Posted July 29, 2005 guictrlsetdata can<{POST_SNAPBACK}>As far as I can figure out, that was true last fall but isn't true now!NYcram
seandisanti Posted July 29, 2005 Posted July 29, 2005 As far as I can figure out, that was true last fall but isn't true now!NYcram<{POST_SNAPBACK}>I've done it very recently with both the full release and the beta without issue... make sure you're including GUIConstants.au3, and may want to make sure that your casing is correct on the function calls... sometimes i run into issues where 'GuiCtrlSetData()' won't work, but 'GUICtrlSetData()' will...
nycram Posted July 29, 2005 Posted July 29, 2005 I've done it very recently with both the full release and the beta without issue... make sure you're including GUIConstants.au3, and may want to make sure that your casing is correct on the function calls... sometimes i run into issues where 'GuiCtrlSetData()' won't work, but 'GUICtrlSetData()' will...<{POST_SNAPBACK}>I'm a newbie, so I cut and paste from the autit help in scite. Here's my gui window:; Make my Window#include <GUIConstants.au3>OPt("GUIOnEventMode", 1)Opt("WinTitleMatchMode", 0) ; any substring will match$WindowHandle = GUICreate ( "xxxxxxxx Automation" , 300 , 200 , 500, 500 ) ; W H L T$Step1Flag = GUICtrlCreateLabel ( " ", 10, 20 , 20 ,15 ) ;L T W H$Step1Text = GUICtrlCreateLabel ( "xxxxxxx", 40, 20 , 100 ,15 ) ;L T W H$Step2Flag = GUICtrlCreateLabel ( " ", 10, 40 , 20 ,15 ) ;L T W H$Step2Text = GUICtrlCreateLabel ( "xxxxxx", 40, 40 , 100 ,15 ) ;L T W H$Step3Flag = GUICtrlCreateLabel ( " ", 10, 60 , 20 ,15 ) ;L T W H$Step3Text = GUICtrlCreateLabel ( "xxxxxx", 40, 60 , 100 ,15 ) ;L T W H$ActionReqd = GUICtrlCreateLabel ( " hoho ", 40, 200 , 100 ,15 ) ;L T W H;GUICtrlSetColor ( $ActionReqd, 0xFF0000)$StartButton = GUICtrlCreateButton ( "Start", 10, 100 , 40 ,20 ) ;L T W HGUICtrlSetOnEvent ( $StartButton, "Startxxxx" )$StopButton = GUICtrlCreateButton ( "Stop", 120, 100 , 40 ,20 ) ;L T W HGUICtrlSetOnEvent ( $StopButton, "Stopxxxx" )GuiSetState(@SW_SHOW)WinSetOnTop ($WindowHandle, "", 1 )HotKeySet("{ESC}", "killthis")and here's the beginning of the Startxxx func that gets started when I push the Start button:Func Startxxxx() msgbox(4096,"Startxxxx", "got here") If WinExists("The window I want") = 0 Then GUICtrlSetData( $ActionReqd, "Start xxxxxx" ) WinWaitActive("The window I want") Else WinActivate("The window I want") EndIf msgbox(4096,"Startxxx", "found window") etc.I never get the text of $ActionReqd to change. I do get both msgboxes, so the code executes.NYcram
seandisanti Posted July 29, 2005 Posted July 29, 2005 I'm a newbie, so I cut and paste from the autit help in scite. Here's my gui window:; Make my Window#include <GUIConstants.au3>OPt("GUIOnEventMode", 1)Opt("WinTitleMatchMode", 0) ; any substring will match$WindowHandle = GUICreate ( "xxxxxxxx Automation" , 300 , 200 , 500, 500 ) ; W H L T$Step1Flag = GUICtrlCreateLabel ( " ", 10, 20 , 20 ,15 ) ;L T W H$Step1Text = GUICtrlCreateLabel ( "xxxxxxx", 40, 20 , 100 ,15 ) ;L T W H$Step2Flag = GUICtrlCreateLabel ( " ", 10, 40 , 20 ,15 ) ;L T W H$Step2Text = GUICtrlCreateLabel ( "xxxxxx", 40, 40 , 100 ,15 ) ;L T W H$Step3Flag = GUICtrlCreateLabel ( " ", 10, 60 , 20 ,15 ) ;L T W H$Step3Text = GUICtrlCreateLabel ( "xxxxxx", 40, 60 , 100 ,15 ) ;L T W H$ActionReqd = GUICtrlCreateLabel ( " hoho ", 40, 200 , 100 ,15 ) ;L T W H;GUICtrlSetColor ( $ActionReqd, 0xFF0000)$StartButton = GUICtrlCreateButton ( "Start", 10, 100 , 40 ,20 ) ;L T W HGUICtrlSetOnEvent ( $StartButton, "Startxxxx" )$StopButton = GUICtrlCreateButton ( "Stop", 120, 100 , 40 ,20 ) ;L T W HGUICtrlSetOnEvent ( $StopButton, "Stopxxxx" )GuiSetState(@SW_SHOW)WinSetOnTop ($WindowHandle, "", 1 )HotKeySet("{ESC}", "killthis")and here's the beginning of the Startxxx func that gets started when I push the Start button:Func Startxxxx() msgbox(4096,"Startxxxx", "got here") If WinExists("The window I want") = 0 Then GUICtrlSetData( $ActionReqd, "Start xxxxxx" ) WinWaitActive("The window I want") Else WinActivate("The window I want") EndIf msgbox(4096,"Startxxx", "found window") etc.I never get the text of $ActionReqd to change. I do get both msgboxes, so the code executes.NYcram<{POST_SNAPBACK}>it works on my pc... one thing i had to change was i had to move the label because it wasn't being displayed...
nycram Posted July 29, 2005 Posted July 29, 2005 it works on my pc... one thing i had to change was i had to move the label because it wasn't being displayed...<{POST_SNAPBACK}>Damn. You don't know how often I stared at the parameters in the window def and compared them against the ones in the label def, without remembering that the parameters are reversed. This after carefully writing the meaning of the parameters in the comments.Sorry.
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