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.




OPTION GUI TRUE
PRAGMA GUI gtk3
 
gui = GUIDEFINE(" \
    { type=WINDOW name=window callback=delete-event title=\"Rosetta Code\" width-request=300 } \
    { type=BOX name=box parent=window orientation=GTK_ORIENTATION_VERTICAL } \
    { type=LABEL name=label parent=box height-request=50 label=\"There have been no clicks yet\" } \
    { type=BUTTON name=button parent=box callback=clicked label=\"Click Me\" }")
 
WHILE TRUE
    SELECT GUIEVENT$(gui)
        CASE "window"
            BREAK
        CASE "button"
            INCR clicked
            CALL GUISET(gui, "label", "label", "Button clicks: " & STR$(clicked))
    ENDSELECT
WEND