How to get a form input using Tkinter in Pygame? How to get a form input using Tkinter in Pygame? tkinter tkinter

How to get a form input using Tkinter in Pygame?


Pygame doesn't have any included form input type stuff, and there's not really a way for Tkinter and Pygame to coexist peacefully in the same window, so you have two options, if you're going to stay within Pygame:

  1. Use a third party library

Phil's Pygame utilities are a pretty good option and provide some good basic functionality like file dialogs, popups, etc. Take a look around the projects on Pygame's website, and see if anyone else's fits your specific needs better.

  1. Code them yourself

Here is a pretty good example of how you'd put together your own input methods. Buttons, lists, and such would be similar as far as event handling is concerned, just check for mouse clicks in each UI element's borders.