Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Alan Gauld
> I wish I understood Tkinter better; I've looked at most of the on-line > stuff, ... > well, after I deliver this one program with Tk, I think I'm going to > switch > to wxPython for future GUI front-ends. Most of the issues discssed on this thread apply to every GUI environment. They all basic

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Danny Yoo
[Keeping Tutor in CC] -- Forwarded message -- Date: Fri, 7 Oct 2005 01:25:26 -0700 (PDT) From: Mike Cheponis <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Simple Tkinter question (fwd) On Fri, 7 Oct 2005, Danny Yoo wrote: > Ok,

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Alan Gauld
>> The problem is that the GUI needs control back to be able to update the >> GUI display. > > Thanks, but what I don't understand is: > > Why doesn't the call tv.set("string") update what's on the screen. > Clearly, > Tkinter has control at that point, and there's no reason to delay updating > t

Re: [Tutor] Simple Tkinter question

2005-10-07 Thread Alan Gauld
> def my_update(): > for i in range(3): > tv.set("Now it's %d"%i) > sleep(1) > > Button(text="Update", command=my_update).pack() > root.mainloop() > > > What happens when I hit the Update button is a 3-second pause, then "Now > it's 2" is displayed. This is a common gotcha in GUI progra

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Danny Yoo
> Danny, I got it: > > from Tkinter import * > from time import * > > def my_update(): >for i in range(3): > tv.set("Now it's %d"%i) > root.update() > sleep(1) > > root=Tk() > tv=StringVar() > Entry(textvariable=tv).pack() > tv.set("Initial Value of StringVar") > Button(text="Upd

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-07 Thread Danny Yoo
-- Forwarded message -- Date: Thu, 6 Oct 2005 23:55:26 -0700 (PDT) From: Mike Cheponis <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Simple Tkinter question Danny, I got it: from Tkinter import * from time import * def my_update():

Re: [Tutor] Simple Tkinter question (fwd)

2005-10-06 Thread Danny Yoo
-- Forwarded message -- Date: Thu, 6 Oct 2005 22:07:50 -0700 (PDT) From: Mike Cheponis <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Simple Tkinter question On Thu, 6 Oct 2005, Danny Yoo wrote: >> from Tkinter import * &

Re: [Tutor] Simple Tkinter question

2005-10-06 Thread Danny Yoo
On Thu, 6 Oct 2005, Mike Cheponis wrote: > I'm trying to update an Entry's textvariable several times within my > Button handler, like so: > > from Tkinter import * > from time import * > > def my_update(): >for i in range(3): > tv.set("Now it's %d"%i) > sleep(1) > > root=Tk() > tv

[Tutor] Simple Tkinter question

2005-10-06 Thread Mike Cheponis
I'm trying to update an Entry's textvariable several times within my Button handler, like so: from Tkinter import * from time import * def my_update(): for i in range(3): tv.set("Now it's %d"%i) sleep(1) root=Tk() tv=StringVar() Entry(textvariable=tv).pack() tv.set("Initial Value o