By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,872 Members | 2,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,872 IT Pros & Developers. It's quick & easy.

Tkinter Button Window exiting whilst running pygame

P: 1
I am a student and I am currently working on an assessment. I am using Tkinter buttons to continue the game. Since I am having multiple buttons, I need to be able to exit out of the button window after i press the button. I have asked many sources including my teachers but all appear to be on dismissing the single button. Can i please have help exiting the Tkinter WINDOW whilst continuing to run pygame.

P.S I am running python 2.7 and the latest pygame.
Aug 3 '15 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 619
You can use grid_forget(), or whatever geometry manager you are using, to remove the frame, and the buttons that are in it. Effbot's doc http://effbot.org/tkinterbook/grid.htm
Aug 3 '15 #2

bvdet
Expert Mod 2.5K+
P: 2,851
Here is another possibility:
Expand|Select|Wrap|Line Numbers
  1. window.grab_release()
  2. window.withdraw()
  3. # do stuff here
  4. # restore the window
  5. window.deiconify()
  6. window.grab_set()
  7.  
Aug 3 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.