Question about GtkEventButton



Hello List,
 
     I have not understood how GtkEventButton structure gets filled up when button-press-event is occured. Following is my code snippet and i have also included output which gives my the values of x,y co-ordinates of mouse as 0,0 each.
 
Code :
=====
static void findCursor(GtkWidget *w, GdkEventButton *event, gpointer data)
{
    printf("GdkEventButton structure is at: %x\n", event);
    printf("Y- co-ordinate of mouse : %d\n", event->y);
}
static void init_gui()
{
    ...
    gtk_signal_connect(GTK_OBJECT(GTK_WIDGET(text)), "button-press-event", GTK_SIGNAL_FUNC(findCursor),NULL);
    ...
}
 
Output:
=====
When i press button in text area, the output on console is as follows
 
GdkEventButton structure is at: 8099c00
Y- co-ordinate of mouse : 0
 
Can anyone please tell me how should i make use of this structure?
 
Thanks in advance,
 
Regards,
Vikram


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]