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

Re: CList selections



On Mon, Oct 18, 1999 at 12:47:40AM +0100,
Chris Jones <chris@black-sun.co.uk> wrote:
> Does someone have some example code for how to get a list of all the
> currently selected rows in a CList?
> 
> I looked in the tutorial and rdp and neither have any info. From the
> headers it looks like it might be CList->selection which is a GList.
> How do I grab some information from this?

Yes, that's how you do it. selection is a list of the selections. The data
member is the number of the row selected. Here's a code snippet
demonstrating its use:

	for (selection = clist->selection; selection;
	     selection = selection->next) {

		row = GPOINTER_TO_INT(selection->data);
		gtk_clist_get_pixmap(clist, row, 0, &pixmap, &mask);
		...
	}

-- 
Eric Gillespie, Jr. <*> epg@pobox.com

"Man is a rope, tied between beast and overman--a rope over an abyss.
 A dangerous across, a dangerous on-the-way, a dangerous looking-back,
 a dangerous shuddering and stopping."
 --Friedrich Nietzsche

PGP signature



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