Aug-21-2020, 07:14 PM
You want to pack the widget you created, not the parent. And generally you don't modify the parent object, you keep track of the widgets yourself (put them in a list or a dict or something). Also, using a variable called "self" when it's not referring to an object reference is non-standard. I'd rename that variable in your function.
I would try:
I would try:
def labels(master,text): var = StringVar() var.set(text) mylabel = Label(master,text=var) mylabel.pack()