Re: Image transparency on a disabled button
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Image transparency on a disabled button

From: Jeff Godfrey <jeff_godfrey@pobox.com>
Date: Fri Sep 30 2005 - 17:53:39 CEST

"Jeff Godfrey" <jeff_godfrey@pobox.com> wrote in message
news:VnE_e.4309$zQ3.3494@newsread1.news.pas.earthlink.net...

> If anyone has any input, I'd be happy to hear it. If someone doesn't
> show me that the problem is *mine* instead of *Tk's* in the next few
> days, I guess I'll file a bug report on SF.

Update - replying to my own post....

Originally, I thought the "disabled button transparency" issue existed in
both standard Tk widgets and Tile based widgets. While that appears to be
true, it's not exactly as I previously stated...

I was in the process of filing a bug on SF this morning, but wanted to
include the steps to recreate the problem. So, in a wish console session I
created a photo image (with transparency) and applied it to a button. When
I disabled the button, it look "correct". Hmmm - what did I think I saw
before?

I then did the same thing with Tile. It did indeed look incorrect (as
described earlier), but (according to Schelte Bron) Joe is going to remove
the stippling code from Tile anyway. So, I'm not so concerned by the issue
in Tile, and have since gotten around it anyway by supplying my own
"disabled" images.

So, back to fiddling with Tk...

The only situation I could find that caused a problem with the transparent
image was as follows... Create a button with a transparent image and then
change the button's background color. Now, any time the button is
disabled, the transparent portions of the image are visible. This is
illustrated by the following code:

image create photo play -file trans.gif ; # a transparent circle
button .b1 -image play
pack .b1 ; # here, the image displays OK
.b1 configure -state disabled ; # also here, the image is OK
.b1 configure -bg red ; # now, it's not OK as the stippled rectangle is
visible

It seems that the stippling done for the disabled image is somehow based on
the buttons original -bg color and is not updated if/when the -bg is
changed.

I guess this must have been what I saw earlier... Though more minor than I
had originally thought, it's been filed on SF.

Thanks,

Jeff
Received on Sat Oct 15 03:53:54 2005