Re: clist selection



I'm using the following method for EXTENDED_SELECTION CList and it is
working perfectly (shoud work for multiple selection CList).
There is a field called selection in the CList structure that holds a g_list
of all the rows selected. Then it is easy to retrieve the selected rows :

 gint SelectedRowRank;

 for (i = 0; i < g_list_length((GTK_CLIST(myCList))->selection); i++)
 {
  /* This is to get the row rank (or index) in the Clist */
  SelectedRowRank =
GPOINTER_TO_INT(g_list_nth_data((GTK_CLIST(myCList))->selection, i));

  /* Now you can use it to access the text field, or whatever you'd like */
  gtk_clist_get_text(GTK_CLIST(myCList), SelectedRowRank, Column,
&pcTextField);
  g_print("Field = %s", pcTextField);
 }


Best regards,
---
Jean-Christophe Berthon


----- Original Message -----
From: "Rok Roskar" <rroskar artsci wustl edu>
To: <gtk-app-devel-list gnome org>
Sent: Tuesday, May 21, 2002 2:16 PM
Subject: clist selection


Is there a way to obtain which rows are selected in a clist? Is this
possible if multiple rows are selected?

Rok

_______________________________________________
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]