EmptySpace Posted January 20, 2012 Share Posted January 20, 2012 (edited) I was trying to make some basic GUI... Only with two buttons but it just wont work. I know that its very simple but I cant find what is wrong. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $mainwindow = GUICreate("home", 197, 49, 192, 124) $Start = GUICtrlCreateButton("Start", 16, 8, 75, 25) GUICtrlSetOnEvent($Start, "Start") $Pause = GUICtrlCreateButton("Pause", 104, 8, 75, 25) GUICtrlSetOnEvent($Pause, "Pause") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func Start() MouseClick("left",100,100) EndFunc Func Pause() MouseClick("right",100,100) ;this is only for example, to see if button works EndFunc Edited April 25, 2012 by Edgaras Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted January 20, 2012 Share Posted January 20, 2012 You are trying to use OnEvent mode but AutoIt runs MessageLoop mode by default, see "GUI Concepts" in helpfile.The default mode is the MessageLoop mode. To switch to OnEvent mode use Opt("GUIOnEventMode", 1).Set GUIOnEventMode to 1 at the beginning of your script. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
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