Re: ListBox
- From: Chris Jones <chris black-sun co uk>
- To: Davina Armstrong <davina lickey com>
- Cc: gtk app <gtk-app-devel-list gnome org>
- Subject: Re: ListBox
- Date: Wed, 29 Nov 2000 23:19:14 +0000
Hi
Davina Armstrong wrote:
I'd love to know if there was a better way to handle this!
Fortunately, there is a way of doing it that doesn't involve a callback
such as yours. It's still not perfect, but it works:
__
GList *foo;
int row;
foo = GTK_CLIST(clist_widget)->selection;
row = GPOINTER_TO_INT(foo->data);
printf ("User selected row: '%d'\n", row);
__
(note that 'foo' is a linked list, so if you have multiple items
selected in the list, simply walk through 'foo' and you can get all of
the rows the user selected).
I guess you could probably write a macro something like this:
#define gtk_clist_get_selected_row(foo)
GPOINTER_TO_INT((GTK_CLIST(foo)->selection)->data)
to get a quick'n'dirty version, but that's untested
off-the-top-of-my-head guesswork, YMMV.
--
_____ _ _ _____
| __ | |___ ___| |_ ___| __|_ _ ___ Chris "Ng" Jones
| __ -| | .'| _| '_|___|__ | | | | chris black-sun co uk
|_____|_|__,|___|_,_| |_____|___|_|_| www.black-sun.co.uk
S o f t w a r e
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]