Sign in to follow this  
Followers 0

OnEvent functions design

2 posts in this topic

How are designed functions like GUICtrlSetOnEvent()? For example I want to create a function to update a control when system time is changed. Well this is quite simple even with AdlibRegister but would be nice to have a function to react just when time has been changed, not keep call a function 10 times/sec to see when the time is changed.

An example using AdlibRegister:


$hMain = GUICreate("OnTimeChange",200,30)
$hCtrl = GUICtrlCreateLabel("",0,0,200,30,0x01)

Until GUIGetMsg() = -3

Func OnTimeChange()
    Static $Last
    Local $New = @HOUR & ":" & @MIN
    If $New <> $Last Then
        $Last = $New

I appreciate any idea. ;)

When the words fail... music speaks

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  
Followers 0