I'm trying to make a basic GUI using Tkinter and have an entry box next to my label using a Grid manager, but the window is not showing when I run my program if I use .grid() with my Entry object.
It does work when I use .pack(), which is strange because I heard not to use .pack() when I have other things using .grid() in the same widget. But I do want to use .grid() because I want to be able to organize it how I want to.
Code is below, I'm having trouble with Entry object showName. The commented out .pack() statement is the one that does work, the .grid() statement is the one that does not work.
Does anybody know what's wrong with this?
from Tkinter import *
class RenamerGUI():
def __init__(self, master):
frame = Frame(master)
frame.pack() #Make frame visible
self.exit = Button(frame, text = "Exit", fg = "red", command = frame.quit)
self.csv2tsv = Button(frame, text = "csv2tsv", fg = "green", bg = "black", command=self.csv2tsv)
self.epguidestsvFormatter = Button(frame, text = "epguidestsvFormatter", fg = "green", bg = "black", command = self.epguidestsvFormatter)
self.epNamesList = Button(frame, text = "epNamesList", fg = "green", bg = "black", command = self.epNamesList)
self.SeasonSplitter = Button(frame, text = "SeasonSplitter", fg = "green", bg = "black", command = self.SeasonSplitter)
self.Renamer = Button(frame, text = "Renamer", fg = "green", bg = "black", command = self.Renamer)
self.showLabel = Label(frame, text = "Show: ")
self.showName = Entry(master)
self.get = Button(frame, text = "Get", command = self.textgetter)
self.exit.grid(row=3, column=4)
self.csv2tsv.grid(row=1, column = 0)
self.epguidestsvFormatter.grid(row=1, column=1)
self.epNamesList.grid(row=1, column=2)
self.SeasonSplitter.grid(row=1, column=3)
self.Renamer.grid(row=1, column=4)
self.showLabel.grid(row=2)
self.showName.grid(row=2, column=1)
#self.showName.pack(side=BOTTOM)
The entry has the wrong parent:
should be