How to open a Pygame window and a Tkinter window simultaneously?

Viewed 685

I'm making a simple game using the Pygame Module. I require a Tkinter window to be open alongside the Pygame window.

Whenever I try to open both the windows, the second window only opens after I kill the first one.

Now, the only solution I can think of, is using multi-threading. But, I'm not able to implement it.

How do I go about this? I would really appreciate some help here. Thank You!

1 Answers

There is a fundamental design issue in pygame that makes it unable to open a window if the process already has a window. It will also prevent other windows from opening while it is running. However, you can open as many TK windows as you like and you can embed a pygame window inside a SDL drawing frame inside a TK window.

See this answer on how to use the drawing frame: Embedding a Pygame window into a Tkinter or WxPython frame

See this answer on how to create multiple windows in tkinter: How to open multiple windows in Tkinter

Related