Re: GtkList
- From: Stephane Duguay <sduguay Matrox COM>
- To: Mike <maddoc en com>, gtk-app-devel-list gnome org
- Subject: Re: GtkList
- Date: Wed, 28 Feb 2001 09:16:07 -0500
Hi,
Mike, Thank you for your answer.
he main problem is that the "get text" method is NOT available with GtkList
(and I don't know why... damn !?!?). If there was one, I could have figured
out a way to retrieve what I need.
Anyway, if anybody else have ever worked with GtkList the way i'm trying to,
please drop me a mail.
Have a good day,
Stephane.
On Tue, 27 Feb 2001, Mike wrote:
On Tuesday 27 February 2001 14:42, Stephane Duguay wrote:
Hi,
I've been looking in the GtkList doc but cannot get my answer.
It looks to me that there's no clean way to get which items are selected
in a list when it's time to check for that (when user press the "Ok"
button).
I think it's a bit crappy to catch all the signals for every
selection/unselection for each item and modifying a global struct all the
time until he click the OK button to then use this structure.
Anyone got an idea to get the list state at a precise moment ?
Yes, as far as I know there is no clean way to get the items selected. Here
is what I'm doing:
GList *selected;
selected = GTK_CLIST(receiver_clist)->selection;
while (selected != NULL)
{
gtk_clist_get_text(GTK_CLIST(clist), GPOINTER_TO_INT(selected->data), 0,
&data);
/* do whatever you need to with data */
selected = selected->next;
}
Sorry, my example is for a CList but the idea is the same for a list, you
just cycle through the linked list grabbing the data until you hit NULL.
Use at your own risk I suppose since you are messing around with an internal
data structure, but it's the only sane way I have found to do it.
Mike
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
____________________________________
Stephane Duguay
Software Designer stagiaire
Matrox Graphics Inc.
E-Mail : sduguay matrox com
Tel. : (514) 822-6000 ext. 7331
Fax : (514) 685-7030
____________________________________
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]