Thank you both I have used Libsoup :) _______________________________________________________________________________________________________________________________ _____________________________________________________________________________________________________________________________________________ From: jonathon quotidian org Have you considered simply using libsoup instead of libcurl? Libsoup can do async I/O integrated with the glib mainloop so that you won't need to use threads (in theory). From: Michael Moorman Hi Kaiser, This one way I would approach this problem. 1. Launch a GLib::Thread to download the files. The API is quite nice and easy to use. 2.
Register a timeout function on the main gtk loop that periodically
checks (maybe once every half second) on the status of the thread you
launched in 1 ( see http://developer.gnome.org/gtkmm-tutorial/3.2/sec-timeouts.html.en
). This can safely update anything on the GUI since it's invoked from
the main loop. Update any GUI related things (progress bar,
error/success indications, etc) using this function. Consider using a Glib::Mutex to facilitate safe communication between the two threads, i.e.
synchronizing access to any shared buffer.
|