Jump to content

can i edit and existing GUI label?


Recommended Posts

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...
Link to comment
Share on other sites

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 H

GUICtrlSetOnEvent ( $StartButton, "Startxxxx" )

$StopButton = GUICtrlCreateButton ( "Stop", 120, 100 , 40 ,20 ) ;L T W H

GUICtrlSetOnEvent ( $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

Link to comment
Share on other sites

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 H

GUICtrlSetOnEvent ( $StartButton, "Startxxxx" )

$StopButton  = GUICtrlCreateButton ( "Stop", 120, 100 , 40 ,20  ) ;L T W H

GUICtrlSetOnEvent ( $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...
Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...