This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,8 @@
package require Tk
# Show off some emacs-like bindings...
pack [label .l -text "C-x C-s to save, C-x C-c to quit"]
focus .
bind . <Control-x><Control-s> {
tk_messageBox -message "We would save here"
}
bind . <Control-x><Control-c> {exit}

View file

@ -0,0 +1,5 @@
bind . <F1> {
foreach c [split "Macro demo!" {}] {
event generate %W $c
}
}

View file

@ -0,0 +1,16 @@
package require Tk
proc sendMacro {w string} {
foreach c [split $string {}] {
# Will not work for < character...
event generate $w $c
}
}
proc macro {key translation} {
bind . <$key> [list sendMacro %W [string map {% %%} $translation]]
}
# Some demonstration macros
macro F1 "Help me!"
macro F2 "You pressed the F2 key"
macro F3 "I'm getting bored here..."
pack [text .t]; # A place for you to test the macros