Re: CList



On Fri, Nov 23, 2001 at 02:04:33AM -0800 Taura Milana wrote:

On 2001.11.23 00:56 Martijn Bos wrote:

Okay you want to look at the GtkCList's member selection (or
selection_end). Handle it using the following code:


GtkCList *clist = myclist;
GList *glist;
gint row;


glist = clist->selection;
while(glist != NULL)
{
      row = (gint)glist->data;        /* Get row number as data pointer.
*/

      /* Handle selected row here. */


      /* Go on to next selected row. */
      glist = glist->next;
}


Now note the above will only work for GtkCList's but not GtkCTree's
casted to GtkCLists. I don't want to give you too much to worry about
now, but if you do decide to get into ctree's write back.

And be sure not to delete the row in this code. Better advance to the next
selected list item directly after you have extracted the row number:
  row = (gint)glist->data;
  glist = glist->next;

Markus.




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