Re: GtkList



There is GTK_LIST(...)->selection, a list of widgets (AFAIK, you
should test it). So use something like:

        for (l = GTK_LIST(list)->selection; l; l = l->next)
          {
            GtkWidget *item = GTK_WIDGET (l->data);
            /* ... */
          }

The widgets itself are GtkListItem's, which contain another widget you
get by GTK_BIN(item)->child.

However, in most cases (when you only need text and pixmaps), a
GtkCList is much faster and uses less memory.

Sebastian

On Tue, Feb 27, 2001 at 02:42:09PM -0500, 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 ?

sorry for bad english...

Thank you,
Stephane
____________________________________

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]