Jump to content
Sign in to follow this  
evilelf

Whats wrong with this...

Recommended Posts

evilelf

I cant seem to get the GUI to

show my Total Runs/Run_Count.

$Label1 = GUICtrlCreateLabel("Total Runs:", 24, 112, 80, 17)
Func _TotalRuns()
$TotalRuns = $Runden; $i
        GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)
    EndFunc
Func start()
For $i = $Runden to 0 step -1
    Call("TotalRuns")
    Call("Click")
Next
EndFunc

Share this post


Link to post
Share on other sites
IndyUK

I cant seem to get the GUI to

show my Total Runs/Run_Count.

$Label1 = GUICtrlCreateLabel("Total Runs:", 24, 112, 80, 17)
Func _TotalRuns()
$TotalRuns = $Runden; $i
        GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)
    EndFunc
Func start()
For $i = $Runden to 0 step -1
    Call("TotalRuns")
    Call("Click")
Next
EndFunc
you don't appear to be call the start function...which means nothings running. try Call("start") at the beginning.

Share this post


Link to post
Share on other sites
evilelf

I do,

Func button1()
    Call("start")
EndFunc

Its just the GUICtrlSetData is not working...

i want it to update label


Share this post


Link to post
Share on other sites
Robjong

change this

GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)

to this.

GUICtrlSetData($Label1, "Total Runs: " & $TotalRuns)

not sure just thought that wasnt right, the 3rd param specifies a default value u can use in a combobox or some.

Share this post


Link to post
Share on other sites
evilelf

change this

GUICtrlSetData($Label1,"Total Runs:",$TotalRuns)

to this.

GUICtrlSetData($Label1, "Total Runs: " & $TotalRuns)

not sure just thought that wasnt right, the 3rd param specifies a default value u can use in a combobox or some.

Its still not working...

Its now showing up in my GUI...


Share this post


Link to post
Share on other sites
PsaltyDS

Its still not working...

Its now showing up in my GUI...

You didn't show us any of your GUI or how you were calling the function you did show, and Robjong was right that you had the parameters wrong.

It works fine like this:

#include <GuiConstantsEx.au3>

Global $TotalRuns = 0
Global $hGUI = GUICreate("Test", 300, 200)
Global $Label1 = GUICtrlCreateLabel("Total Runs: 0", 20, 20, 260, 20)
Global $Button1 = GUICtrlCreateButton("RUN", 100, 150, 100, 30)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $TotalRuns += 1
            GUICtrlSetData($Label1,"Total Runs: " & $TotalRuns)
    EndSwitch
WEnd

:)


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

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.