search functionally



On Sun, 05 Dec 1999 05:45:50 Ragnar Henriksen wrote:
> 
> As I said earlier; I'm working on searching for mail. But I got a problem
> I really don't understand.
> 
> Maybe someone here could tell me why?
> 
> This doesn't work:
> 	
> list = GTK_CLIST(data)->row_list;
> 
> while ( list ) {
>    message = gtk_clist_get_row_data(GTK_CLIST(data), 
>                          GPOINTER_TO_INT(list->data));
>    printf("this is the subject: %s\n", message->subject);
>    list = list->next;
> }
> 
> 
> But when I put:
> 
> list = GTK_CLIST(data)->selection;
> 
> instead. It work. And if i comment out the printf line and add a counter,
> i counts the correct number of messages (both using row_list and
> selection).
> 

Ummm, in what manner does it "not work"? Core dump? Loop exits immediately?

> Can it have something to do with that I'm loading the search-dialog from a
> shared library? (did that so it won't be loaded unless you need it).
> 

I was thinking of this problem for the new installer (with proper GTK types
instead of those set_datas) until I was reminded: Linux, and I believe all
other operating systems, don't load code pages until they are referenced. 
So if you never use the searching it won't be loaded. Then, if you do, it will
be loaded, and swapped out if the need arises.

==============================
Peter Williams peter@newton.cx



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