Widget Demo 解体新書:フロアプラン
set c [canvas .c -width 250 -height 200] pack $c -expand yes -fill both |
$c create polygon 0 88 0 14 14 14 14 0 73 0 73 14 147 14 147 88 118 88 118 103 \
29 103 29 88 -fill {#ffbebe} -tags floor1
$c create polygon 0 85 0 29 29 29 29 0 73 0 73 14 147 14 147 73 73 73 73 88 \
-fill {#ffdede} -tags floor2
$c create polygon 14 29 73 29 73 14 118 14 118 73 14 73 \
-fill {#ffbede} -tags floor3
|
$c move floor1 1c 1c $c move floor2 .5c .5c |
$c bind floor1 <1> "$c raise floor1" $c bind floor2 <1> "$c raise floor2" $c bind floor3 <1> "$c raise floor3" |

$c config -scrollregion [$c bbox all] bind $c <2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" |