Re: query_interface on tree models

On 22 Jan 2001, Havoc Pennington wrote:

> Hi,
> We have a problem in that certain tree models can have capabilities
> that others do not. Examples so far:
>  - some can sort themselves when a column header is clicked, e.g. 
>    GtkTreeModelSort
>  - some can be reordered or have rows deleted/added via drag-and-drop
>  - some can have their cell contents changed via editable tree rows
>    (not implemented, but will be someday)
> The issue is that you want GtkTreeView to dynamically discover the
> available functionality and set things up to work. e.g. if a model is
> sortable, automatically sort when the user clicks a column header.
> Best solution so far proposed is to add interfaces such as
> GtkTreeModelSortable and have models implement those; then 
> the GtkTreeView would see if the model conforms to the relevant
> interface and set things up automatically if it does.
> Objections, better ideas?

not really. actuall alternatives are models leaving extra
fucntions in a vtable NULL or using G_RUN_ACTION signals
for which existance could be queried. both are ugly workarounds
around real interface support and since we got that now, we
should use it ;)

> Havoc


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