Ask Your Question
3

On Mac OS, there is a problem with tkinter when it is combined with pygame.

asked 2022-04-28 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-09-22 06:00:00 +0000

ladyg gravatar image

This is because both tkinter and pygame require access to the main event loop in order to run properly. However, they each have their own event loops that can conflict with each other.

To solve this problem, there are a few possible solutions:

  1. Use pygame's event loop exclusively and avoid using tkinter's mainloop() function. This can be done using Pygame's event.get() function to handle events.

  2. Use a separate thread for tkinter to run in. This can be done using python's threading module. However, this can make the code more complex and difficult to manage.

  3. Use a different GUI library that is compatible with pygame, such as PyGTK or PyQT. These libraries have their own event loops that can coexist with pygame's event loop.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-28 11:00:00 +0000

Seen: 13 times

Last updated: Sep 22 '21