Re: threads and trayicon error

anguila wrote:

I use 2 threads, the first one, execute the to get the news, and
the second wait $wait_time_error (the time acces to get the info from the
web) to join the first thread for update the trayicon online or offline.

I'd suggest not using threads for this purpose... too complicated and 
error-prone. It's not allowed to call Gtk+ functions outside the thread
which started the main loop, so you need to start a pure worker thread 
communicating with the main thread to update the GUI etc.

You already have a separate process for the http stuff, so it's easy to
install an I/O watcher on your pipe and response to the events instead 
of struggling with threads.

That's very common and you find an example for this in Gtk Perl docs, 
e.g. here:

  [ 18. How do I keep my GUI updating while doing a long file read? ]



Think before you code. And while you're doing it probably won't hurt. ;)

Attachment: pgpKZbuSoe0RV.pgp
Description: PGP signature

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