Hello,

        Thanks for the reply.  I'm puzzled here; I have a camera running in
the background grabbing frames from the camera; running some preprocessing
on the frames and then presenting the image on the window.  I'm also
thinking of recording some entries into a database and possibly making some
network calls when the app is runnign in an 'admin' mode.  I've programmed
Java, .NET and so on and the normal method I would use for this is to run
the camera in one thread in the background, then if I make remote calls or
execute lengthy databse queries from an event on the form (clicking a button
or somethign like that).  If I don't use threads for this then what would be
the 'typical' pyGTK method to handle both background tasks and executing
lengthy events from GUI events.

  I'm asking because I don't want to use a paradigm from another experience
which is not suitable to what I'm trying to do with python and gtk.  Thanks
for your help.

Cheers,

Neil

On 14 May 2010 19:09, Neil Muller
<[email protected]<drnlmuller%[email protected]>
> wrote:

> On 14 May 2010 19:48, Neil Benn <[email protected]> wrote:
> > This starts up as you would expect, printing a and b to the screen as the
> > threading time time slicing allows. However once the PyGTK window has
> opened
> > - these threads just freeze.
>
> To use threads, you need to enable pygtk's support for threads by
> calling gtk.gdk.threads_init().
>
> http://unpythonic.blogspot.com/2007/08/using-threads-in-pygtk.html is
> a good brief overview of how to use pygtk and threads.
>
> It's also worthwhile reading the gtk+ notes on threading at
> http://developer.gimp.org/api/2.0/gdk/gdk-Threads.html , especially if
> you're trying to write something portable between X11 and Windows.
>
> I would, however, recommend looking at alternative options, such as
> multiprocessing, carefully first, before committing yourself to a
> threaded solution.
>
> --
> Neil Muller
> [email protected]
>
> I've got a gmail account. Why haven't I become cool?
> _______________________________________________
> pygtk mailing list   [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>



-- 
-- 

Neil Benn Msc
Director
Ziath Ltd
Phone :+44 (0)7508 107942
Website - http://www.ziath.com

IMPORTANT NOTICE:  This message, including any attached documents, is
intended only for the use of the individual or entity to which it is
addressed, and may contain information that is privileged, confidential and
exempt from disclosure under applicable law.  If the reader of this message
is not the intended recipient, or the employee or agent responsible for
delivering the message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify Ziath Ltd immediately by email at [email protected]. Thank you.
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to