Re: GtkComboBox design issues



Dan Winship <danw helixcode com> writes: 
> I think the autocompletion thing may be more of a GtkEntry thing than
> a GtkComboBox thing. (Using Evolution as an example again, you
> obviously don't want to have a combo box with a pop-up menu of
> everyone in your addressbook, but once the user starts typing, you do
> want to suggest completions.) I think it would be nice to have this
> functionality be part of GtkEntry, and have GtkComboBox just make the
> appropriate gtk_entry_ calls on its entry to set completion up to work
> the way that makes sense for a combo box.
> 

Good idea. That sounds like the Right Thing to me. So the text combo
box just adds the extra dropdown, and causes the entry autocomplete to
work in terms of the items in the extra dropdown.

Though there's some cost in convenience, probably the entry should use
signals/callbacks to get the list of completions, since it would be
inconvenient and slow to gtk_entry_set_possible_completions (entry,
list_of_completions) in cases where the completions come from e.g. a
readdir(). And it seems lame to keep copies of the combo strings in
both the combo list and the entry.

Or maybe we can have a virtual get_completions() function for the case
where it's needed for efficiency, and also have
set_possible_completions() for simple cases.

Havoc





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