Re: [INIMSS] How to get the currently selected row of a GtkCList?



ypu can get the member selection of the clist.
selection itself is a structure (GList).
this selection is a linked list. the data member of this structure will
hold an integer value wich is the selected row.
Whenever you have more rows selected the linked list gets bigger.

Take a look at the sample (it works for me) :

GList * selection;
int ID;

Selection = GTK_CLIST(CL)->selection;   /*get the list with selected
rows*/
      if (Selection != NULL)  /*if selection == NULL then no row was
selected*/
 {
     while( Selection->next != NULL)
       {
           ID = (int)Selection->data;
           .............
           ............   do what you want with the row
        }
 }


May be it helps.
Good luck

Martijn

Dino Cherian K wrote:

Hi

How can I get the currently selected row of a GtkCList, from an event
handler of another widget?
For Example, how to get the currently selected row's number from a
"button_click" event handler.

Thanks
Dino CK

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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