Jump to content
Sign in to follow this  

Few quick questions

Recommended Posts


Hi All,

Few quick questions that I’m hoping you will be able to answer.

1. I need a quick simple line of code to clear a text field created with GuiCtrlCreateInput when I press a button.

2. I am after a way to put a little clock on my dashboard/launcher. I am able to have it stamp the current time when I open it, but I am unable to have it continually update with the system time. Is that possible, would anyone be able to point me in the right direction?

Eg case $msg = $clearbox


Thanks in advance

Share this post

Link to post
Share on other sites

Case $Btn_Clear
GUICtrlSetData($Input, "")

- edit -

probably not the best way for your second question ...

GUICreate("Example", 150, 75, -1, -1)
$Input = GUICtrlCreateLabel('', 15, 50, 118, 15)
While 1
$DateTime = @MON & "/" & @MDAY & "/" & @YEAR & "    " & @HOUR & ":" & @MIN & ":" & @SEC
GUICtrlSetData($Input, $DateTime)
Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post

Link to post
Share on other sites

A control loop like this will give you both constant polling of events (buttons, inputs, etc) and an independant timer to perform some periodic refresh:

#Include <Timers.au3>
$delay = 2000 ; milliseconds

$timer = _Timer_Init()
While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $Button_Whatever
            Do the voodoo that you do here
        Case $Button_Clear
        Case $Button_Exit, $GUI_EVENT_CLOSE
    If _Timer_Diff($timer) > $delay Then
        Beep(800,50) ; refresh the auditory nerve
        $timer = _Timer_Init()
Edited by Spiff59

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.