Skip to content

Instantly share code, notes, and snippets.

@elliottminns
Created February 28, 2026 14:49
Show Gist options
  • Select an option

  • Save elliottminns/1e0a11c9b629db8339de7512878bea97 to your computer and use it in GitHub Desktop.

Select an option

Save elliottminns/1e0a11c9b629db8339de7512878bea97 to your computer and use it in GitHub Desktop.
package require Tk
set count 0
# Label that displays the count
label .lbl -text "Count: $count" -font {Helvetica 18}
pack .lbl -padx 20 -pady 10
proc update {} {
global count
.lbl configure -text "Count: $count"
}
# Button that increments count
button .btn -text "+1" -command {
incr count
update
}
pack .btn -padx 20 -pady 10
# Button to reset the count
button .reset -text "Reset" -command {
set count 0
update
}
pack .reset -padx 20 -pady 10
@boussou
Copy link

boussou commented Mar 2, 2026

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment