Task

Create a window that has:

   a label that says   "There have been no clicks yet" 
   a button that says   "click me"


Upon clicking the button with the mouse, the label should change and show the number of times the button has been clicked.




include EuWinGUI.ew
 
Window("EuWinGUI - Simple windowed application",100,100,360,100)
constant Button1 = Control(Button,"Click me",250,20,80,25)
constant Label1 = Control(Label,"There have been no clicks yet",10,25,200,18)
 
integer clicks
clicks = 0
 
-- Event loop
while 1 do
    WaitEvent()
    if EventOwner = Button1 and Event = Click then
        clicks += 1
        SetText(Label1,sprintf("You clicked me %d times",clicks))
    end if
end while
 
CloseApp(0)