Hello All,
I will be more than grateful if you could find time for answering me.
General:I am writing a GUI, in which I receive real time video from several cameras of a robot (using ROS).
Hierarchy:GtkWidget ---points to---> GtkPixbuf ---points to---> IplImage (for each frame of the video).
Goal:Connect the widget that holds the image to signal/event of a mouse clicking, in order to perform some operations (resizing on click).
I have tried to do it in this way:Code:
// Connecting the created widget to a "button_press_event".
g_signal_connect_after ( G_OBJECT(pToImageManagmentStruct->pGtkImgWindow),
"button_press_event",
G_CALLBACK(callbackForImageResizing),
NULL
);
void callbackForImageResizing ( GtkWidget* imageWidget, gpointer dataForCallback )
{
// The needed code
}
But this is not working.
Possible solution:I have found this link:
http://justlinux.com/forum/showthread.php?t=132908.
But:
a. I am not sure that this is the right way.
b. This will also require a change in my working code, which is not wanted.
c. This is a very old link.
Questions:1. How should I achieve my goal?
2. What is the difference between an event and a signal? What is the right way in my case?
3. Maybe I should use "gtk_widget_add_events" or "gtk_widget_set_events"?
Thank you all in advance,
Felix.