Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75918 > unrolled thread

Tkinter frame reset

Started byNicholas Cannon <nicholascannon1@gmail.com>
First post2014-08-08 17:38 -0700
Last post2014-08-09 14:46 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Tkinter frame reset Nicholas Cannon <nicholascannon1@gmail.com> - 2014-08-08 17:38 -0700
    Re: Tkinter frame reset Vlastimil Brom <vlastimil.brom@gmail.com> - 2014-08-09 14:46 +0200

#75918 — Tkinter frame reset

FromNicholas Cannon <nicholascannon1@gmail.com>
Date2014-08-08 17:38 -0700
SubjectTkinter frame reset
Message-ID<c9b244b6-12ca-485b-96e3-a8bd372d23f5@googlegroups.com>
Ok so I am working on a little project and I cant seem to solve something with it. I have a label and then a clear button and I want all the numbers in the label to clear when I push the button. This button is on a separate frame to the buttons. I would like to clear the frame and then set all the widgits back to how they were one you first open the app(Label being blank). I have tried to destroy it with frame.destry() and then try re create it in a function but it never recreates its self. Also when I tried grid_forget() on it, it never came back either when I tried to frame it and then grid it back on there. I can clear the label by just adding a long blank string to it to overwrite the numbers behind because I would like to have the user add more numbers in there like starting fresh. This long blank string wont work because the buttons add on to the existing string so the label keeps getting updated with the new buttons pressed. I tried to remove the label but that never came back either. Please help me with trying to clear the label or the whole window back to its original blank settings

[toc] | [next] | [standalone]


#75946

FromVlastimil Brom <vlastimil.brom@gmail.com>
Date2014-08-09 14:46 +0200
Message-ID<mailman.12793.1407588364.18130.python-list@python.org>
In reply to#75918
2014-08-09 2:38 GMT+02:00 Nicholas Cannon <nicholascannon1@gmail.com>:
> Ok so I am working on a little project and I cant seem to solve something with it. I have a label and then a clear button and I want all the numbers in the label to clear when I push the button. This button is on a separate frame to the buttons. I would like to clear the frame and then set all the widgits back to how they were one you first open the app(Label being blank).
...
> --
> https://mail.python.org/mailman/listinfo/python-list

Hi,
I haven't been doing anything more complex for some time now with
tkinter, but could you maybe just associate the appropriate variables,
keep them in a list and change the values in a loop as appropriate -
without recreating the gui?
cf. the basic recipe:
http://effbot.org/tkinterbook/label.htm
v = StringVar()
Label(master, textvariable=v).pack()
v.set("New Text!")
hth,
  vbr

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web