<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=&quot;pict.gif&quot;)<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=&quot;Hello&quot;, bd=0)<br>cwgt.create_window(20,20, window=b1, anchor=NW)<br>
root.mainloop()<br><br>(supply your own &#39;pict.gif&#39;)<br><br>The canvas shows the image as background, and<br>the button on top, functional. However, the button&#39;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 &lt;<a href="mailto:ggpolo@gmail.com">ggpolo@gmail.com</a>&gt; wrote:<br>&gt; On Sat, Jul 19, 2008 at 8:30 PM, Tim Jones &lt;<a href="mailto:timj@tolisgroup.com">timj@tolisgroup.com</a>&gt; wrote:<br>
&gt;&gt; On Jul 19, 2008, at 4:20 PM, Alexnb wrote:<br>&gt;&gt;<br>&gt;&gt;&gt; Guilherme Polo wrote:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; On Sat, Jul 19, 2008 at 7:43 PM, Alexnb &lt;<a href="mailto:alexnbryan@gmail.com">alexnbryan@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; So, is there a way I can make the background of a frame an image and<br>&gt;&gt;&gt;&gt;&gt; still have all the widgets (buttons in this case) remain where they are and<br>&gt;&gt;&gt;&gt;&gt; how<br>
&gt;&gt;&gt;&gt;&gt; they work?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; You could just use a Label with a image and use this Label as the parent<br>&gt;&gt;&gt;&gt; for other widgets you want to place over it. You will probably also want to<br>
&gt;&gt;&gt;&gt; set the window geometry according to this background image dimensions.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt; Okay, I tried that and the area just showed up white :(. What do you<br>&gt;&gt;&gt; suggest?<br>
&gt;&gt;<br>&gt;&gt; Unfortunately, this is one of the aspects of TK that isn&#39;t quite right on OS<br>&gt;&gt; X. &nbsp;You could use a drawn image of a button on your backdrop image and then<br>&gt;&gt; monitor for the mouseclick position to determine that the pseudo-button was<br>
&gt;&gt; pressed, but without proper ties to the Carbon Compositor, it&#39;s best to use<br>&gt;&gt; pushbuttons only on default, blank backgrounds.<br>&gt;&gt;<br>&gt;<br>&gt; Does that happen when using a Canvas too ? Same in Tk 8.5 ? I&#39;m<br>
&gt; curious, mainly because I don&#39;t have a mac to test.<br>&gt;<br>&gt;&gt; Sorry the news isn&#39;t better.<br>&gt;&gt;<br>&gt;&gt; Tim<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Tkinter-discuss mailing list<br>
&gt;&gt; <a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>&gt;&gt; <a href="http://mail.python.org/mailman/listinfo/tkinter-discuss">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>
&gt;&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; -- Guilherme H. Polo Goncalves<br>&gt; _______________________________________________<br>&gt; Tkinter-discuss mailing list<br>&gt; <a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/tkinter-discuss">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>&gt;<br><br></div></div></div>