Creates a window with a black-and-yellow striped frame around it. When grabbed at this frame, the window can be dragged around the screen. [Zarutian] 13. july 2005: ---- #IS: mætti gera: 7 hluta tölustafi í rauðum útlínum #EN: migth do: 7 segmented numbers in red outlines #EN: to move the window about drag an edge. image create photo cautionEdge set a #000000 set b #FFFF00 cautionEdge put [list \ [list $a $a $a $b $b $b $a $a $a $b $b $b ] \ [list $b $a $a $a $b $b $b $a $a $a $b $b ] \ [list $b $b $a $a $a $b $b $b $a $a $a $b ] \ [list $b $b $b $a $a $a $b $b $b $a $a $a ] \ [list $a $b $b $b $a $a $a $b $b $b $a $a ] \ [list $a $a $b $b $b $a $a $a $b $b $b $a ] \ [list $a $a $a $b $b $b $a $a $a $b $b $b ] \ [list $b $a $a $a $b $b $b $a $a $a $b $b ] \ [list $b $b $a $a $a $b $b $b $a $a $a $b ] \ [list $b $b $b $a $a $a $b $b $b $a $a $a ] \ [list $a $b $b $b $a $a $a $b $b $b $a $a ] \ [list $a $a $b $b $b $a $a $a $b $b $b $a ] \ ] canvas .can -width [expr 26 * 12] -height [expr 19 * 12] .can configure -highlightthickness 0 wm overrideredirect . 1 pack .can proc range {start end {delta 1}} { set res [list] for {set i $start} { $i <= $end } { incr i $delta } { lappend res $i } set res } foreach x [range 0 25] { .can create image [expr $x * 12] 0 -image cautionEdge -anchor nw \ -tags [list cautionEdge cautionEdge[set x]x0 ] .can create image [expr $x * 12] 216 -image cautionEdge -anchor nw \ -tags [list cautionEdge cautionEdge[set x]x18 ] } foreach y [range 1 17] { .can create image 0 [expr $y * 12] -image cautionEdge -anchor nw \ -tags [list cautionEdge cautionEdge0x[set y] ] .can create image 300 [expr $y * 12] -image cautionEdge -anchor nw \ -tags [list cautionEdge cautionEdge25x[set y] ] } set draggin 0 .can bind cautionEdge { set draggin [list 1 %X %Y] } .can bind cautionEdge { if {[lindex $draggin 0]} { set tmp [split [wm geometry .] "+"] set oldx [lindex $draggin 1] set oldy [lindex $draggin 2] set x [expr [lindex $tmp 1] - ($oldx - %X) ] set y [expr [lindex $tmp 2] - ($oldy - %Y) ] wm geometry . "312x228+[set x]+[set y]" set draggin [list 1 %X %Y] } } .can bind cautionEdge { set draggin 0 } .can configure -background LightYellow ''[escargo] 13 Jul 2005'' - Just so you can quit it... bind all { exit } .can create text 156 114 -text "Press Q to quit" ''[PWQ]'' under FVWM, overridden windows cannot take focus, so key presses are not seen by the caution window. ---- [Category Example] | [Category GUI]