My Checkbox C1
does not show up and causing the problem to never finish. What's going on here?
from Tkinter import *
class LabeledEntry(Frame):
def __init__(self, parent, *args, **kargs):
text = kargs.pop("text")
Frame.__init__(self, parent)
Label(self, text=text, justify=LEFT).grid(sticky=W, column=0, row=0)
Entry(self, *args, **kargs).grid(sticky=E, column=1, row=0)
class User_Input:
def __init__(self, parent, fields):
GUIFrame = Frame(parent)
GUIFrame.pack(expand=True, anchor=NW)
field_index = 1
for field in fields:
self.field = LabeledEntry(GUIFrame, text=field)
self.field.grid(column=0, row=field_index, pady=1)
self.field.grid_columnconfigure(index = 0, minsize = 150)
field_index += 1
CheckVar1 = IntVar()
self.C1 = Checkbutton(parent, text = "checkbox1", variable = CheckVar1, onvalue = 1, offvalue = 0)
self.C1.grid(column=2, row=2)
fields = ['Entry Box 1:', 'Entry Box 2']
root = Tk()
MainFrame = User_Input(root, fields)
root.mainloop()