[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Can pygame and TKInter work together?



On Tue, 2005-11-15 at 12:21 -0700, Nathan Pinno wrote:
> I have a question regarding pygame and TKInter. Can I use both of them
> together in the same application without getting errors?

This was posted awhile ago, but I don't think got a reply. The straight
answer is no, they cannot run together. They both compete for system
control and resources and cannot cooperate.

Buuuuut.

If you are really sure this is what you want, there are ways of
shoehorning it. The SDL display can be embedded into an existing window.
I will warn you this is a bit tricky and has a wide variety of success
and failure on different computers.

The trick is to set the environment variable SDL_WINDOWID before
initializing pygame. This must be a string of the window's HWND or id
number. Most toolkits allow for getting the system id/handle for a
widget.

On windows I'd strongly recommend also setting SDL_VIDEODRIVER=windib.
The directx backend will commonly crash when running embedded like this.