🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.lang.tcl
Article #202

Re: [Q] I can't line precisely on canvas..

#202
From: Shigeki Ohira
Date: Sat, 15 Nov 1997 00:00
38 lines
1953 bytes
$BBgJ?!wAa0pED$G$9!#(B

 |$B%9%/%m!<%k%P!<Ey$rMQ$$$F1&J}8~$K%9%/%m!<%k$5$;$?>l9g!"(B
 |$B;OE@$,$O$k$+:8$NJ}$K$"(B$B$C$F=*E@$N$_@5>o0LCV$K%W%m%C%H$5$l$^$9!#(B
 |
 |proc CanvB1Press {sheet x y} {
 |  global dx1 dy1 dx2 dy2 count
 |  set c $sheet
 |  set sx [$c canvasx $x]
 |  set sy [$c canvasy $y]
 |
 |  bind $c <ButtonRelease-1> "drawLine $c $x $y %x %y"
 |  proc drawLine {c sx sy cx cy} {
 |    global dx1 dy1 dx2 dy2 count
 |    set cx [$c canvasx $cx]
 |    $c create line $sx $sy $cx $sy -width 2 -fill red
 |    set dx1($count) $sx
 |    set dy1($count) $sy
 |    set dx2($count) $cx
 |    set dy2($count) $sy
 |    puts ($sx,$sy)-($cx,$sy) ;### $B3NG'=PNO(B
 |    incr count
 |  }
 |}

$B%U%)%m!<%"%C%W$N$H$*$j!"JQ?t$N<u(B$B$1EO$7$r4V0c$($F$*$j$^$7$?!#(B
bind $c <ButtonRelease-1> "drawLine $c $sx $sy %x %y"
$B$H$9$k$3$H$G!"L\E*(B$B$r2L$?$9$3$H$,$G$-$^$7$?!#(B
$B%U%)%m!<$7$F$/$@$5$C$?J}!9!"$"$j$,$H$&$4$6$$$^$7$?!#(B
--
    $B"i(B    $B"i(B   []=====================================[]
   $B"i!2(B  $B!2"i(B  []  $BAa0pEDBg3X(B $BM}9)3XIt(B $B>pJs3X2J#4G/(B   []
   $B"j(B$B"~(!"~($(B  [] $BCN<1>pJs9)3X@l96(B $BGr0f8&5f<<(B $B2;@<HI(B  []
   $B"j(B  $B"](B  $B"_(B  []      $BBgJ?(B $BLP51(B (Ohira Shigeki)      []
   $B"j!@"^!?"j(B  []E-mail:ohira@shirai.info.waseda.ac.jp[]
     $B!@!1!?(B    []=====================================[]       
       $B"w(B      
Technical Details
Message-ID: <G94P0211.97Nov15173500@wise21.mn.waseda.ac.jp>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <G94P0211.97Nov8020730@wise21.mn.waseda.ac.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: 15a83d,7659ec1e7f169b51
X-Google-Attributes: gid15a83d,public
From: g94p0211@mn.waseda.ac.jp (Shigeki Ohira)
Subject: Re: [Q] I can't line precisely on canvas..
Date: 1997/11/15
Message-ID: <G94P0211.97Nov15173500@wise21.mn.waseda.ac.jp>
X-Deja-AN: 289710307
Distribution: fj
References: <G94P0211.97Nov8020730@wise21.mn.waseda.ac.jp>
Organization: Centre for Informatics, WASEDA University
Newsgroups: fj.lang.tcl