On Wed, Mar 12, 2003 at 12:05:44PM -0300, Christian Reis wrote:
> On Wed, Mar 12, 2003 at 08:50:06AM -0600, Jon Nelson wrote:
> > > Can't this while become:
> > >
> > >     while self.check_events and gtk.events_pending():
> > >       gtk.mainiteration()
> > >
> > > And we use the check_events flag like I described before?
> > 
> > yes it can, but it (essentially) does the exact same thing.
> 
> With a slightly lower ugli-T-ness<tm> rating, and only 3 added calories.
> 
> > I'll verify your soln. works, but it's essentially the same.
> > What I'd *really* like is to find out if there is a way to accomplish
> > what I'm trying to do here.
> > 
> > The user-perceivable problem is that (assume
> > do_real_work_with_data_read_from_file takes perhaps a minute), the
> > application is "frozen" because mainiteration can't be called to update
> > progress bars, show messages, update cursors, etc...
> 
> Well, calling mainiteration *inside* a callback is bound to be tricky
> and produce races and deadlocks. I'm not sure ig gtk2 handles this
> better, but maybe some gtk2 ninja can step up and give you the ultimate
> reason to upgrade? :-)

Yes, gtk+ 2 handles this much better, by not handling it. All this
input/timeout stuff was moved to glib. The MainLoop/Context stuff is
much more flexible than GTK 1.2. Take a look at
g_source_set_can_recurse. The default is false, which prevents
reentrancy for an input/timeout/idle function, but you can set it to
true.

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to