For Programmers: Free Programming Magazines  


Home > Archive > Tcl > November 2006 > Re: transparency









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: transparency
slebetman@yahoo.com

2006-11-29, 10:03 pm

Uwe Klein wrote:
> Jeff Hobbs wrote:
>
> What about using unmanaged/undecorated toplevels for the segments?
> withdraw and place as you like it.
> Ok, the segments can only be rectangles.


Neat idea! You mean something like this? :

proc drawTransDigit {rootname x y number} {
set ret [list]
if {[string is integer -strict $number] &&
[string length $number] == 1
} {
set segmentList {
a 02356789 10 0 50 10
b 045689 0 10 10 50
c 01234789 60 10 10 50
d 2345689 10 60 50 10
e 0268 0 70 10 50
f 013456789 60 70 10 50
g 0235689 10 120 50 10
}
foreach {segment group x1 y1 width height} $segmentList {
if {[string first $number $group] != -1} {
lappend ret [toplevel $rootname$segment -bg red]
wm attributes $rootname$segment -topmost 1
wm overrideredirect $rootname$segment 1
incr x1 $x
incr y1 $y
wm geometry $rootname$segment ${width}x${height}+${x1}+${y1}
}
}
}
return $ret
}

proc drawTransNumber {rootname x y number} {
set ret [list]
foreach i [split $number {}] {
set ret [concat $ret [drawTransDigit $rootname$x $x $y $i]]
incr x 100
}
return $ret
}

# Test:
set foo [drawTransNumber .test 10 10 12345]

# To delete do:
# foreach x $foo {destroy $x}

Uwe Klein

2006-11-30, 4:16 am

exactement!

very nice,
the "-topmost" option to [wm attributes] breaks on X11.

everything being indented at least one space sugests
you have already put it on the wiki?

uwe
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com