transparency



hi,
as a tutorial project i tried to create a simple digital clock (which is pretty easy task), however i wanted it to look cool (:

and here comes my problem, id like my clock to appear on desktop as digits only, but cant find a way to make label's background transparent

im aware that there are some problems with tk with regard to transparency (did bit of google search), but i wonder whether its possible to arrive at solution to this particular problem (doesnt have to be general, and may include some external libraries, however id like to stick to tcl)

code goes below

proc every { ms body } {
eval $body
after $ms [list every $ms $body]
}

proc dragStart {windowX windowY} {
set ::DragHoldPosition(x) $windowX
set ::DragHoldPosition(y) $windowY
}

proc dragTo {screenX screenY} {
set positionX [expr { $screenX - $::DragHoldPosition(x) }]
set positionY [expr { $screenY - $::DragHoldPosition(y) }]
wm geometry . [winfo width .]x[winfo height .]+$positionX+$positionY
}

bind . <Button-1> { dragStart %x %y }
bind . <Button1-Motion> { dragTo %X %Y }
bind . <Button-2> { destroy . }

pack [label .lab -textvariable timevar -font "ansi 54 bold" -foreground #aa66ff]

wm overrideredirect . 1
wm attributes . -alpha 0.5 -topmost 1
every 500 {set ::timevar [clock format [clock sec] -format %H:%M:%S]}
.


Quantcast