[Tkinter-discuss] Making an image the background of a Frame

Tim Jones timj at tolisgroup.com
Sun Jul 20 01:30:31 CEST 2008


On Jul 19, 2008, at 4:20 PM, Alexnb wrote:

> Guilherme Polo wrote:
>>
>> On Sat, Jul 19, 2008 at 7:43 PM, Alexnb <alexnbryan at gmail.com> wrote:
>>>
>>> So, is there a way I can make the background of a frame an image  
>>> and still have all the widgets (buttons in this case) remain where  
>>> they are and how
>>> they work?
>>
>> You could just use a Label with a image and use this Label as the  
>> parent for other widgets you want to place over it. You will  
>> probably also want to set the window geometry according to this  
>> background image dimensions.
>>
> Okay, I tried that and the area just showed up white :(. What do you  
> suggest?

Unfortunately, this is one of the aspects of TK that isn't quite right  
on OS X.  You could use a drawn image of a button on your backdrop  
image and then monitor for the mouseclick position to determine that  
the pseudo-button was pressed, but without proper ties to the Carbon  
Compositor, it's best to use pushbuttons only on default, blank  
backgrounds.

Sorry the news isn't better.

Tim



More information about the Tkinter-discuss mailing list