Skip to content

Instantly share code, notes, and snippets.

@hkoba
Created May 17, 2020 03:23
Show Gist options
  • Save hkoba/f3f16f98c90637ba4e409e38e965bc7e to your computer and use it in GitHub Desktop.
Save hkoba/f3f16f98c90637ba4e409e38e965bc7e to your computer and use it in GitHub Desktop.
A demo for Tcl/Tk's `[send]` command. (Requires Tk8.6 on Unix with Xwindow support).
#!/usr/bin/wish
# -*- mode: tcl; coding: utf-8 -*-
tk appname AppX
set X 0
pack [button .b -text "Increment var in AppY" -command {
send AppY [list incr Y]
}] -fill both -expand yes
pack [entry .e -textvariable X] -fill x -expand no
#!/usr/bin/wish
# -*- mode: tcl; coding: utf-8 -*-
tk appname AppY
set Y 0
pack [button .b -text "Increment var in AppX" -command {
send AppX [list incr X]
}] -fill both -expand yes
pack [entry .e -textvariable Y] -fill x -expand no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment