Re: gtk_filesel: Showing file in file clist



Lars Clausen <lrclause cs uiuc edu> writes:

> Hi!
>
> We're again trying to improve the gtk_filesel widget, this time by making
> the file clist automatically show the file that the program sets the
> selection to (if possible).  Unfortunately, it turns out to be rather
> difficult.  There is no gtk_clist_find_row_from_text, there is no
> gtk_clist_get_num_rows (which would allow us to do a binary search).  The
> best solution we can see is not very good:  Attaching a strdup() of the
> text as data to each row and use gtK_clist_find_row_from_data to find the
> row (what is the complexity on that anyway?  Linear?  Log?), being very
> careful to deallocate the data.  Surely there must be a better way to find
> rows in clists?  Any suggestions would be appreciated.

If this filesel is targeting GTK+ 2.0, you should use the new list/tree
widget (GtkTreeView et al.)  This way you can store the directory
information in your own data structure, and export it to the widget as
necessary.

Currently, I am in the midst of making a large change to the model
interface, and it's a little under-documented.  I can check in the
documentation I have later today, with the completed change (assuming I
fully finish.)  Also, please feel free to point out any problems with
the list.  It is under-tested at the moment, and I'm not sure how useful
the API is yet.

Thanks,
-Jonathan




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