[Tkinter-discuss] Method to call when gui is first displayed
Cameron at phaseit.net
Mon Nov 27 18:10:19 CET 2006
On Mon, Nov 27, 2006 at 05:44:38PM +0100, mkieverpy at tlink.de wrote:
> > > >I want to call the function which talks to CVS after the gui is displayed,
> > > >but without formal having to do anything.
> > .
> > > The problem is: you should use the event callback just to start
> > > the network activity, not monitoring it.
> > > You'll need some kind of threading/subprocesses or other
> > > to do this.
> > > The event types are not well documented in my tk/tcl installation,
> > > so I cannot tell you if '' is the best choice here.
> > .
> > ? I suspect we're confusing each other. It certainly is possible
> > to monitor network activity in an event-oriented way; were you say-
> > ing that you do not recommend such an approach?
> No. What I wanted to say is that the gui is inactive while an event callback
> is processed. So the Map-event callback should only be used to initiate the
> network activity but return immediately afterwards.
> (not polling/waiting for the end of network transfer).
> Different events/callbacks or similar should be used for monitoring.
> But, of course, Fredrik Lundh's proposed method is better
> (I did not know this one), if the application allows for network
> activity to finish with the gui being inactive.
Ah! All cleared up. I entirely agree: it's best to
define a distinct event/poll/monitor/...
And, yes, as always, Fredrik's counsel is on-target.
More information about the Tkinter-discuss