I have tried a ton of things, and I looked at a lot of tutorials please help/
So here is a very basic example of how to put a label
and an entry
widget into a window using tkinter:
def make_window():
win = tk.Tk()
label = tk.Label(win, text='Here is a label')
label.pack()
dflt = tk.StringVar(win, 'default')
entry = tk.Entry(win, textvariable = dflt)
entry.pack()
win.mainloop()
That’s an Entry
widget rather than a Text
widget.
The Text
widget is called, naturally, Text
.
However, it doesn’t support tkinter StringVar
, so you need to use its get
method, supplying the start and end positions within the contents. For all, use a start value of '1.0'
(i.e. line 1, column 0) and an end value of 'end'
.
thanks this will help
also thanks