<div dir="ltr">Hi,<br><br>I ran the following on my Mac running python2.5.2 under Panther:<br>from Tkinter import*<br><br>root = Tk()<br>cwgt=Canvas(root)<br>cwgt.pack(expand=True, fill=BOTH)<br>image1=PhotoImage(file="pict.gif")<br>
# keep a link to the image to stop the image being garbage collected<br>cwgt.img=image1<br>cwgt.create_image(0, 0, anchor=NW, image=image1)<br>b1=Button(cwgt, text="Hello", bd=0)<br>cwgt.create_window(20,20, window=b1, anchor=NW)<br>
root.mainloop()<br><br>(supply your own 'pict.gif')<br><br>The canvas shows the image as background, and<br>the button on top, functional. However, the button's<br>normal border is there in white (see img below).<div>
Would be good to have a button<br>with a transaprent background, but buttons in Mac Tkinter<br>are the MacOS buttons, which are hard to change.<br><br><img src="webkit-fake-url://5AAC9E04-9A90-41C2-81CD-00BDE427F254/image.tiff"><div>
<br>Mick<br><br><br><br><br>On Sun, Jul 20, 2008 at 2:12 AM, Guilherme Polo <<a href="mailto:ggpolo@gmail.com">ggpolo@gmail.com</a>> wrote:<br>> On Sat, Jul 19, 2008 at 8:30 PM, Tim Jones <<a href="mailto:timj@tolisgroup.com">timj@tolisgroup.com</a>> wrote:<br>
>> On Jul 19, 2008, at 4:20 PM, Alexnb wrote:<br>>><br>>>> Guilherme Polo wrote:<br>>>>><br>>>>> On Sat, Jul 19, 2008 at 7:43 PM, Alexnb <<a href="mailto:alexnbryan@gmail.com">alexnbryan@gmail.com</a>> wrote:<br>
>>>>><br>>>>>> So, is there a way I can make the background of a frame an image and<br>>>>>> still have all the widgets (buttons in this case) remain where they are and<br>>>>>> how<br>
>>>>> they work?<br>>>>><br>>>>> You could just use a Label with a image and use this Label as the parent<br>>>>> for other widgets you want to place over it. You will probably also want to<br>
>>>> set the window geometry according to this background image dimensions.<br>>>>><br>>>> Okay, I tried that and the area just showed up white :(. What do you<br>>>> suggest?<br>
>><br>>> Unfortunately, this is one of the aspects of TK that isn't quite right on OS<br>>> X. You could use a drawn image of a button on your backdrop image and then<br>>> monitor for the mouseclick position to determine that the pseudo-button was<br>
>> pressed, but without proper ties to the Carbon Compositor, it's best to use<br>>> pushbuttons only on default, blank backgrounds.<br>>><br>><br>> Does that happen when using a Canvas too ? Same in Tk 8.5 ? I'm<br>
> curious, mainly because I don't have a mac to test.<br>><br>>> Sorry the news isn't better.<br>>><br>>> Tim<br>>><br>>> _______________________________________________<br>>> Tkinter-discuss mailing list<br>
>> <a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>>> <a href="http://mail.python.org/mailman/listinfo/tkinter-discuss">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>
>><br>><br>><br>><br>> --<br>> -- Guilherme H. Polo Goncalves<br>> _______________________________________________<br>> Tkinter-discuss mailing list<br>> <a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/tkinter-discuss">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>><br><br></div></div></div>