diff options
author | Miller Puckette <millerpuckette@users.sourceforge.net> | 2009-08-17 23:31:36 +0000 |
---|---|---|
committer | Miller Puckette <millerpuckette@users.sourceforge.net> | 2009-08-17 23:31:36 +0000 |
commit | 282671282b20fa17ab9dbbaba9d1cf2246b5029d (patch) | |
tree | f7af53ee269efd2564ca872a4da187e1ae687f3b /pd/tcl/pdtk_text.tcl | |
parent | 76d1c8472e025126a4b3e1571f817198b2fec9f9 (diff) |
merge in new tcl implementation by Steiner & Chun
svn path=/trunk/; revision=11934
Diffstat (limited to 'pd/tcl/pdtk_text.tcl')
-rw-r--r-- | pd/tcl/pdtk_text.tcl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pd/tcl/pdtk_text.tcl b/pd/tcl/pdtk_text.tcl new file mode 100644 index 00000000..bb37ccc3 --- /dev/null +++ b/pd/tcl/pdtk_text.tcl @@ -0,0 +1,20 @@ + +package provide pdtk_text 0.1 + +############ pdtk_text_new -- create a new text object #2########### +proc pdtk_text_new {mycanvas canvasitem x y text font_size color} { + $mycanvas create text $x $y -tags $canvasitem -text $text -fill $color \ + -anchor nw -font [get_font_for_size $font_size] + $mycanvas bind $canvasitem <Home> "$mycanvas icursor $canvasitem 0" + $mycanvas bind $canvasitem <End> "$mycanvas icursor $canvasitem end" + if {$::windowingsystem eq "aqua"} { # emacs bindings for Mac OS X + $mycanvas bind $canvasitem <Control-a> "$mycanvas icursor $canvasitem 0" + $mycanvas bind $canvasitem <Control-e> "$mycanvas icursor $canvasitem end" + } +} + +################ pdtk_text_set -- change the text ################## +proc pdtk_text_set {mycanvas canvasitem text} { + $mycanvas itemconfig $canvasitem -text $text +} + |