Created
November 28, 2017 19:41
-
-
Save novel-yet-trivial/a354fef60905db5a781de309a45c8740 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
class menu: | |
def __init__(self): | |
self.game = tk.Tk() | |
self.game.geometry('200x200') | |
self.var = tk.StringVar() | |
#~ self.var = tk.StringVar(master=self.game) # this solves the problem | |
ent = tk.OptionMenu(self.game, self.var, 'one', 'two', 'three', 'four') | |
ent.pack() | |
lbl = tk.Label(self.game, textvariable=self.var) | |
lbl.pack() | |
btn = tk.Button(self.game, text="new window", command=self.playagain) | |
btn.pack() | |
self.game.mainloop() | |
def playagain(self): | |
menu() | |
menu() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment