Re: Right way to tap into the main loop



Ok, thanks Thomas and Lionel, that is what I'm looking for!

Kind regards, 
-Elias


2014-08-14 15:05 GMT+02:00 Thomas Schüßler <vindolin gmail com>:
I have no experience with reading from a TTY but if you have a file descriptor you could monitor it with:

GLib.io_add_watch(fd, GLib.IO_IN, some_callback_func)

Regards
Thomas



On 08/11/2014 12:20 AM, Elias Bakken wrote:
Hi!

I'm using Python for this:
I'm in need of setting up a loop that checks for messages from a virtual TTY and displays the
message once it comes in. Since Clutter.main() hogs the main thread, setting up a normal thread from the main thread does nothing. Setting up a separate process circumvents this, but I see no way of
passing the message back to the main thread which has the stage handle etc.

Is it possible to use a ClutterEvent or signals for this?

I've managed to implement a working version using a time-line that signals a a check
for new messages every 0.1 seconds, but if would be way cleaner to have an actor or whatever
that emits a signal when a message is on queue.

Any takers for this? I guess really the question is how to subclass some event class and override or create a new signal method..

Kind regards, 
-Elias


_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list


_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]