Clist_get_selction



Alright guys, I have been running into a little road block and am trying to get around it.  The basic idea is I want a pop-up window to emerge everytime a row in a clist is right-clicked.  So far, I am using the button_press_event callback on the clist to evoke a function to handle a right click.  Now inside the callback function I have this little snippet of code to find the row and col that was right clicked:

void on_clist1_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)

{

if(event->button==3){

int *row,*col;

gtk_clist_get_selection_info(GTK_CLIST(user_data),int(event->x,(int)event->y,row,col)}

}

This code however gives me a seg fault when I right click over a cell in the clist.  Whats going wrong?  The user_data is the clist I pass the function, not NULL.  Does it have something to do with the casting of event->x from a double to an int?  I wouldn't think so.  Is there an easier way to catch what rowl was selected or what row the mouse pointer was over when a right-click was given?

 

Thanks guys!



Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes

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