Re: menus and images with transparent background



Hi Shamil

Actually it doesn't matter witch image type the file is, the result is an image object.
I tested again with a gif file and got the same results, to demostrate the problem, here is the display, when clicked the right mouse button:


http://www.wellcode.com/download/badmenu.png

And if I go over the menu items, the display shows good:

http://www.wellcode.com/download/goodmenu.png

I also used the following example (without Package Img 3.0)

#package require Img 1.3
image create photo icon1 -file [file normalize {C:\WINDOWS\pchealth\helpctr\System\sysinfo\graphics\chip.gif}]; #change to existing icon
pack [button .b -text "Click Right Mouse Button Here"]
bind .b <3> "postmenu %X %Y"
set var1 on
proc postmenu {x y} {
catch {destroy .m}
menu .m -tearoff 0
.m add command -label command
for {set i 0} {$i < 10} {incr i} {
set ::var$i on
.m add checkbutton -label "check $i" -onvalue on -offvalue off -variable ::var$i
.m add command -label "command $i" -image icon1 -compound left
}
::tk_popup .m $x $y
}





shamil wrote:
I believe the problem is with the .ico images.  I tried with the a .gif
image (with transparency) and didn't have a problem.



--
Try Code-Navigator on http://www.codenav.com
a source code navigating, analysis and developing tool.
It supports following languages:
    * C/C++
    * Java
    * .NET (including CSharp, VB.Net and other .NET components)
    * Classic Visual Basic
    * PHP, HTML, XML, ASP, CSS
    * Tcl/Tk,
    * Perl
    * Python
    * SQL,
    * m4 Preprocessor
    * Cobol
.