Re: CTree inheritance from CList



On Mon, Aug 03, 1998 at 02:09:30PM -0400, Elliot Lee wrote:
> gtk_widget_show() works on all GtkWidgets, so gtk_clist_set_row_data()
> should work on CTree's too.

gtk_clist_set_row_data works for GtkCTree. But there are functions with
analog names which won't work. E.g. gtk_clist_insert does not enough.
Anyway I can't hinder anyone from calling it for GtkCTree as long as it's
no class function.

> However, gtk_clist_set_row_data() and
> gtk_ctree_set_row_data() have different (and possibly incompatible)
> signatures.
> 
> This happens to work OK for C programs most of the time, but sucks in
> languages such as Objective C, where all methods with the same name (in
> this specific example, "set_row_data") must have the same signature.

I think that's OK for class funktions, but these funktions only have
analog names. I can change the function name a little bit, but that
won't make a big difference, except, that people won't see the analogy.

> The CTree analogues for the CList routines also breaks expected behaviour.
> For example, gtk_ctree_set_row_data() just sets the data directly, without
> sending the select_row signal that gtk_clist_set_row_data() does.

Out of gtkclist.c :

/* re-send the selected signal if data is changed/added
 * so the application can respond to the new data -- 
 * this could be questionable behavior */

I'm not to happy with this selection signal, so I left it out for ctree.
We can change that, if that's terribly wrong.

> Perhaps:
> 
> (a) If gtk_clist_set_row_data() doesn't work for subclasses, perhaps it
>     needs to be genericized so it will

This function works, but as I mentioned before, invisible nodes don't even
have a row number, so it would be impossible, to set the row data of an
invisible row.

> 	or
> (b) GtkCTree doesn't really have that much in common with GtkCList

As you can see, CTree has much in common with CList. Unfortunately it
works with a row number in many places (which is a reasonable thing
for a List). But that's not enough for CTree.

> 	or
> (c) gtk_ctree_set_row_data() needs to be renamed, and also somehow
>     implemented in terms of gtk_clist_set_row_data()

I can't see the point these functions don't have the same name, they do
analog things and therefore have analog names.

bye,
  Lars



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