Ticket #2112: test2.au3

File test2.au3, 856 bytes (added by hebrayah@…, 13 years ago)

non correct script

Line 
1#include <GUIConstantsEx.au3>
2
3#include <Debug.au3>
4_DebugSetup("Scribe debuger", True)
5
6Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode
7$mainwindow = GUICreate("Hello World", 200, 100)
8GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
9GUICtrlCreateLabel("Hello world! How are you?", 30, 10)
10$okbutton = GUICtrlCreateButton("OK", 70, 50, 60)
11GUICtrlSetOnEvent($okbutton, "OKButton")
12GUISetState(@SW_SHOW)
13
14While 1
15  Sleep(1000)  ; Idle around
16WEnd
17
18Func OKButton()
19  ;Note: at this point @GUI_CTRLID would equal $okbutton,
20  ;and @GUI_WINHANDLE would equal $mainwindow
21  MsgBox(0, "GUI Event", "You pressed OK!")
22EndFunc
23
24Func CLOSEClicked()
25  ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,
26  ;and @GUI_WINHANDLE would equal $mainwindow
27  MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
28  Exit
29EndFunc