[Glade-users] GTK+ threads: works great but compile-time warning
- From: pdbuchan at yahoo.com (David Buchan)
- Subject: [Glade-users] GTK+ threads: works great but compile-time warning
- Date: Sat, 28 May 2011 17:58:10 -0700 (PDT)
Hi guys,
Info: Ubuntu (lucid), gtkbuilder from glade 3.6.7, C language with gcc.
I took some of Tadej's thread code from his Bits and Pieces blog post, and modified it to closer to what I
need.
Specifically, I moved the thread creation into a callback, on the basis that I understood that all callbacks
were inside main's threadlock so it should be equivalent. I removed the timeout.
You click on button1 and it's label will cycle from "thread" to "cycle" each second. You click on button2 to
stop it.
It does the job, but gives a compile-time warning:
test5.c: In function ?on_button1_clicked?:
test5.c:33: warning: passing argument 1 of ?g_thread_create_full? from incompatible pointer type
/usr/include/glib-2.0/glib/gthread.h:225: note: expected ?GThreadFunc? but argument is of type ?void *
(*)(struct TestData *)?
Note that I call g_thread_create not g_thread_create_full.
Comments?
Code attached.
Thanks,
Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test5.c
Type: text/x-c
Size: 2272 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110528/7ebd62a1/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test5.h
Type: text/x-chdr
Size: 431 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110528/7ebd62a1/attachment-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 354 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110528/7ebd62a1/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test5.glade
Type: application/x-glade
Size: 1392 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110528/7ebd62a1/attachment-0002.bin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]