Re: Finding out CList row selections



Well, let's say I have GList *sel = clist->selection;.
If I want to access the stuff in there, I would use
sel->data. My question is, what is 'data' exactly? What
type of structure is it? What members inside of 'data'
would give me the number of that row?

Andy Kahn wrote:
> 
> > This is somewhat of an extension of my last question, but
> > I would also like to know if there's an easy way to find
> > out which rows have been selected. In the past, I've had
> > to make a struct for each item added with two fields, one
> > for the item name and another for if that row was selected
> > or not. Is this the way it must be done or is there
> > something easier?
> 
> You can use the list of selected rows, clist->selection, which is just
> a linked list (GList).  However, if your selected list is sufficiently
> large, getting the length of it to count the number of elements might
> be a tad slow.
> 
> regards,
> --andy

-- 
+-----------------------------------------------------+
| Jeff "Shippy" Shipman     E-Mail: shippy@cs.nmt.edu |
| Computer Science Major    ICQ: 1786493              |
| New Mexico Institute of Mining and Technology       |
| Homepage: http://www.nmt.edu/~shippy                |
+-----------------------------------------------------+




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