Updated 2010-06-29 17:53:04 by ARR

tktrans apparently implements shaped windows. It is available only for Windows.

lexfiend 4 Dec 2005: The project home page is at [1], but the binary distribution at SourceForge [2] seems to have been stubs-enabled by Jeff Hobbs, so it's probably a better bet.

schlenk 4 Dec 2005: Sadly this doesn't play nice with wm attributes -alpha.

JH The -alpha issue, or any call that causes a rewrap of the toplevel hwnd wraper (like overrideredirect), is that the SetWindowRgn API is applied to the toplevel hwnd wrapper "behind Tk's back", so when it rewraps, that is lost. Tk could look for that - assuming somebody might set it, but you should try and reapply the region after such changes.

MG This isn't actually related to TkTrans, but I'm guessing caused by the same thing as JH described there. I had some software installed (part of my graphics card) which allowed setting any window to be always on top. When I set a Tk program's window to always on top programatically (with wm attributes $win -topmost 1), then turned it off using this other program, Tk still reported it being always on top, and from then on in, any time i changed it in Tk, it reported the wrong setting. I'm guessing this is because querying wm attributes $win -topmost uses an internal counter to tell whether it's set always on top, instead of asking the OS, and Tk didn't ever see that it had been changed elsewhere?

DKF: This package works by using the bright magenta parts of an image as a mask. This is a horrible trick. FW: Not bright magenta in general, at least, just #FF00FF. Ro: Supposedly this is called magic pink [3].

JH: I have a variant that works based off the transparent pixel (fully transparent areas are not drawn - partial transparency isn't supported, but may be possible in Win 2000+). Tk also has wm attributes $win -transparentcolor $rgb since 8.4.16. This should supersede TkTrans as you can build up an overrideredirect canvas and do whatever is necessary. RT Very nice addition, works well and lets trktrans fade away w/o being missed. - Thanks Jeff and Activestate! 25Feb2009

[ARR]: tktrans can be used to make a transparent window item on a canvas:

tktrans::setwidget $widget $transparent_image

This is fine if we can prepare a static image. But I want to create a transparent checkbutton on the canvas. The Idea: I create a window on the canvas with a checkbutton. Then I make a dynamic image from the checkbutton widget:

image create photo transparent_image -format window -data $widget

This is fine, but the checkbutton widget must be fully visible. So, how can I make an image from a unvisible widget? Any ideas?