I need to use g_idle_add()
in a C++
code, where a GSourceFunc
is another class function and have to pass some arguments also. Have seen its use in C code only. So may be I am not getting the things right
While using g_idle_add()
in a C code is straight forward
C program
g_idle_add ((GSourceFunc) functionA, someData);
where functionA is a function defined in that C program file scope and someData is a structure
C++ program
g_idle_add ((GSourceFunc) (mObjOfAnotherClass->functionB (* p_SomeVariable)), NULL)
Also, consider the scenario where I have to pass more than one arguments to functionB
The difference here is about the scope of functions called from g_idle_add. Can I call the g_idle_add() like I have done above in sample C++ code