From 282671282b20fa17ab9dbbaba9d1cf2246b5029d Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Mon, 17 Aug 2009 23:31:36 +0000 Subject: merge in new tcl implementation by Steiner & Chun svn path=/trunk/; revision=11934 --- pd/tcl/pdtk_text.tcl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pd/tcl/pdtk_text.tcl (limited to 'pd/tcl/pdtk_text.tcl') 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 "$mycanvas icursor $canvasitem 0" + $mycanvas bind $canvasitem "$mycanvas icursor $canvasitem end" + if {$::windowingsystem eq "aqua"} { # emacs bindings for Mac OS X + $mycanvas bind $canvasitem "$mycanvas icursor $canvasitem 0" + $mycanvas bind $canvasitem "$mycanvas icursor $canvasitem end" + } +} + +################ pdtk_text_set -- change the text ################## +proc pdtk_text_set {mycanvas canvasitem text} { + $mycanvas itemconfig $canvasitem -text $text +} + -- cgit v1.2.1