I am using pygame to write a program and I need some GUI configuration text field and button for control. I've already made the button using pygame, but I just can write a text field out of pygame. Maybe I need to use tkinter together with pygame.
I think if there is no way to made to pygame part and tkinter part together in 1 window, then I could put them into 2 separate windows.
I hope the tkinter part can update the global variable in my pygame part, would there if any problem? I might create a child process of tkinter from the pygame part so that the tkinter part can probably "see" the global variable in pygame part and modify them.
Can I do this? Are there any pitfalls?
I have also found pgu is awful. However, what you say about the tkinter event loop taking control is wrong. You just call root.update instead of mainloop, and this can go inside of a while loop to replace the mainloop. Answering your main question however, there is something you should be aware of. It seems that whenever I run the two programs alongside each other, this traceback occurs:
TclError: expected boolean value but got "-1"
Fatal Python error: (pygame parachute) Segmentation Fault
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Because of this I would avoid the combination, although I suspect this particular issue may pertain to my use of threads.
Is there anything I need aware of using Tkinter and pygame together?