Re: Finding which row is selected in a CList



  Hello,

  I don't know if it's the best way to do what you want but you can try 
this : 

  gtk_signal_connect(GTK_OBJECT(c_list), 
                     "select_row", 
                     (GtkSignalFunc)get_number, 
                     NULL);

where get_number is this function :

void get_number(GtkCList *clist, 
                gint row, 
                gint column, 
                GdkEventButton *event, 
                gpointer data)
{
  g_print("The number is : : %d !!\n", row); 
}

It does the job on my computer. Then, you can store the number of the 
selected row in a global variable instead of print it :-) . 

  Vincent

On Thu, 23 May 2002, Jayson Hay wrote:


Hi All,

I have a button that, when clicked should get a number from a cell in
the selected row of a clist. I have passed the clist to the function as
user_data and I am using the following to get the text I need:

      gtk_clist_get_text (user_data, NULL, 0, &message);

What I want to do is change NULL to the number of the currently selected
row in the clist. Is there a way to do this? I have the gtk docs and
cant find what I'm looking for there.

jay

----------------------------
ii swear I never use vi^[:wq
----------------------------
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


-- 
TORRI Vincent
Mathematiques Appliquees Bordeaux                                                
Institut de Mathematiques                                                       
Universite Bordeaux 1                                                           
351 cours de la liberation                                                      
33 405 Talence cedex - France                                                   
                                                                                
Tel : 33 (0)5 57 96 21 42                                                       
Fax : 33 (0)5 56 84 26 26                                                       
--




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