Re: [Tkinter-discuss] update of elements in GUI

2010-08-19 Thread Alex Ter-Sarkissov
thnx a lot, Firat, I sorted it out a few minutes b4 reading yr post) i just needed 2 loops: one for the counter (while j > I am not sure whether my understanding of your problem is correct, but if I > am not wrong you want something like this: > > http://paste-it.net/public/i866d84/ > > > > 2010/

Re: [Tkinter-discuss] update of elements in GUI

2010-08-19 Thread Firat Ozgul
I am not sure whether my understanding of your problem is correct, but if I am not wrong you want something like this: http://paste-it.net/public/i866d84/ 2010/8/19 Alex Ter-Sarkissov > Ok, it actually seems to work, apart from one thing: what if I need to > update an array, rather than a sing

Re: [Tkinter-discuss] update of elements in GUI

2010-08-18 Thread Alex Ter-Sarkissov
Ok, it actually seems to work, apart from one thing: what if I need to update an array, rather than a single element? I mean, each iteration I store an array, then use it the next iteration (naturally, the first array is generated randomly). This worked for the counter: 1. def run(*args): 2

Re: [Tkinter-discuss] update of elements in GUI

2010-08-18 Thread Alex Ter-Sarkissov
thanks guys, this does seem to work...nevertheless, since I'm quite new to both python and gui design, one more question: how would I do the same, but launching the counter at the click of the button? I tried (from Firat's last example) def increment(*args):var.set(var.get()+1)root.after(1

Re: [Tkinter-discuss] update of elements in GUI

2010-08-18 Thread Firat Ozgul
[quote]Cameron Laird: "update() is *not* essential: after() provides a non-threading alternative."[/quote] I agree. If you would not like to use update(), you can use after() in your code with pretty much the same functionality: http://paste-it.net/public/e7ce371/ ___

Re: [Tkinter-discuss] update of elements in GUI

2010-08-18 Thread Cameron Laird
On Wed, Aug 18, 2010 at 08:19:38AM +0300, Firat Ozgul wrote: . . . > If I am not mistaken you want something like this: > > 1) http://paste-it.net/public/i2de44d/ (with threads and classes) > > 2) http://paste-it.net/public/f

Re: [Tkinter-discuss] update of elements in GUI

2010-08-17 Thread Firat Ozgul
If I am not mistaken you want something like this: 1) http://paste-it.net/public/i2de44d/ (with threads and classes) 2) http://paste-it.net/public/f5e340e/ (without threads and classes) Note that without threads, we need to use the update() method. However, without threads you will experience so

Re: [Tkinter-discuss] update of elements in GUI

2010-08-17 Thread Alex Ter-Sarkissov
thanks, in one of these articles it says. 'Be careful - Tkinter in not re-entrant'. MAybe this is the problem? So far I've tried (1) Label(mainframe.update_idletasks(),textvariable=best,bg='#321000',fg='#000fff000',font=("Helvetica",x1)).grid(column=1,row=1) and (2) mainframe = Frame(root) main

Re: [Tkinter-discuss] update of elements in GUI

2010-08-17 Thread Cameron Laird
On Wed, Aug 18, 2010 at 12:50:38AM +1200, Alex Ter-Sarkissov wrote: . . . > I have some elements on the screen (Labels, most importantly) which content > has to be updated every iteration of the algorithm run, e.g. "Iteration =

[Tkinter-discuss] update of elements in GUI

2010-08-17 Thread Alex Ter-Sarkissov
I have some elements on the screen (Labels, most importantly) which content has to be updated every iteration of the algorithm run, e.g. "Iteration =" [i] for i in range(n). I've tried using mainframe.update_idletasks() and Label(mainframe.update_ideltasks(),textvariable=var).grid(column=1,row=1),