I have a small program where a gtk signal callback function needs 2 or 3 variables.
I don't want to make these global variables (The entire goal of the project is to be neat and tidy) and I don't want to make a whole struct just so I can send a widget and a compiled regex to a function.
As far as I've seen g_signal_connect
only allows for a single data variable.
Would the most efficient way of doing this perhaps be an array of void pointers to the two objects in question? Something like this?
void * data[2];
data[0] = widget;
data[1] = compiledregex;
g_signal_connect(save,"clicked",G_CALLBACK(callbackfunction),data);