Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can tcl/tk realize transparent color?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
When I use tcl/tk canvas, I hope I could draw some object with transparent color. Can tcl/tk'canvas realize this function? And if it can, how realize it ?
 
By "transparent" do you mean you want to draw an object that you can't see? If so, set the canvas color and the object color to be the same. If you want to be able to see the object and the object underneath it, maybe you can try a "stipple" pattern? Bob Rashkin
rrashkin@csc.com
 
It's also possible to create canvas items with a -fill attribute set to the empty string. For example, here's a little "hide and seek" with an invisible rectangle on a canvas:

Code:
canvas .c
pack .c
.c create rect 20 20 50 50 -fill ""     -width 0 -tag active
.c bind active <ButtonPress-1> {
    puts &quot;You clicked me!&quot;
}
- Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top