On 24 October 2012 04:34, Ardhan Madras <ard...@rocksis.net> wrote: > > Hi, > > > Now that from GTK+ 3.6, thread functions are deprecated. Is there any > > new rules to do threading with the gtk+ 3.6 version? > > Are you talking about Glib? yes, there are many changes since 2.32 > (for now stable version is 2.34), from high level view, the changes > such as new thread creation functions, thread reference counting > functions, thread synchronization tools, etc. and many other functions > and macros has been removed. >
Comparing: http://developer.gnome.org/gdk3/3.4/api-index-deprecated.html http://developer.gnome.org/gdk3/stable/api-index-deprecated.html I can see that gdk_threads were recently removed. But there is no guide on how to move away from those. Regards, Dmitrijs. > In 2.32 and above to create a thread you will use the new > g_thread_new() or the g_thread_try_new() (previously with > g_thread_create()), to create synchronization tools for example a > rwlock then you call g_rwlock_init (previously g_rwlock_new() or > G_STATIC_RWLOCK_INIT), call g_thread_unref() after you finish with the > thread. > > > I tried */g_main_context_invoke/*, but seems it did not work. I can't > > update GUI from that GSourceFunc. Maybe is my mistaken use... > > I don't understand why you call g_main_context_invoke() here but If > you want to call GTK+ functions from your thread, the safe method is > to wrap the functions to a GSourceFunc and call it with g_idle_add() > or g_idle_add_full() (from your thread function). > > Regards. > > > On Tue, Oct 23, 2012 at 9:43 AM, Weitian Leung <just_fa...@live.com> wrote: > > Hi, > > Now that from GTK+ 3.6, thread functions are deprecated. Is there any > > new rules to do threading with the gtk+ 3.6 version? > > Just for an example, I want to download many files in background, and > > show the progress in GUI, how should I do it? > > I tried */g_main_context_invoke/*, but seems it did not work. I can't > > update GUI from that GSourceFunc. Maybe is my mistaken use... > > Anyone know how? Or just give me some examples. > > > > Sorry for my bad English. > > Thanks. > > > > -- > > Weitian > > > > _______________________________________________ > > gtk-app-devel-list mailing list > > gtk-app-devel-list@gnome.org > > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > > > > -- > Please do not send me any propriety format such as Microsoft Offices: > Word, Excel, Power Point, etc. Please use standard non-propriety > format such as plain text, HTML, PDF or OpenOffices format. > > ROCKSIS | Indonesia > _______________________________________________ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list