On Nov 13, 2009, at 8:45 AM, Roger Gammans wrote:

> I've got a project which need to fille in a dtextox with data that
> comes from an external HID , whose iterface is a simple char device.
> (On *nix platform).
>
> I considered write a seperate monitoring thread for this which
> blocks on the device node until data is availabel and then calls
> a supplied callback.
>
> The problems with this are that without fancy thread footwork,
> the callback is not called from the 'GUI' thread. Which can
> IIRC cause GTK issues.

        The guideline is that only the main process can update the GUI. If  
another thread tries to update, either it won't work or it won't work  
when you want it to. I've had success with callbacks, as long as the  
called-back method executes in the main app loop.

> Has anyone ever done anything like this , or think of an alternate
> model. For instance is there anyway I can insert a poll() or select()
> call int othe dabo/wx mainloop?


        Sure, with dabo.ui.callEvery(interval, func, *args, **kwargs)


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to