1 # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
3 # $Id: Textinsert.tcl,v 1.4 2004-03-21 07:30:58 vvzhy Exp $
5 ###### Textinsert.tcl ######
6 ############################################################
7 # Netmath Copyright (C) 1998 William F. Schelter #
8 # For distribution under GNU public License. See COPYING. #
9 ############################################################
11 proc mkTextItem
{ c x y args
} {
13 global _fixed_default _prop_default fontSize
14 set helvetica
$_prop_default
15 set courier
$_fixed_default
17 set font [assoc
-font $args [list $helvetica $fontSize]]
18 set tags
[assoc
-tags $args {}]
19 set item
[$c create
text $x $y -text " " -width 440 -anchor n
-font $font -justify left
]
21 foreach v
$tags { $c addtag
$v withtag
$item}
22 $c bind text <1> "textB1Press $c %x %y"
23 $c bind text <B1-Motion
> "textB1Move $c %x %y"
24 $c bind text <Shift-1
> "$c select adjust current @%x,%y"
25 $c bind text <Shift-B1-Motion
> "textB1Move $c %x %y"
26 $c bind text <KeyPress
> "textInsert $c %A"
27 $c bind text <Return
> "textInsert $c \\n"
28 $c bind text <Control-h
> "textBs $c"
29 $c bind text <BackSpace
> "textBs $c"
30 $c bind text <Delete
> "textDel $c"
31 $c bind text <2> "textPaste $c @%x,%y"
35 ## endsource textinsert.tcl