Re: GTK+ is real object oriented?



On Mon, 21 Dec 2009 08:34:06 -0200
frederico schardong <frede sch gmail com> wrote:
>  I like C sintax, but is it that create this confusion to me... Thanks
>  for clearly, and I agree that GTK is OO.

It's OO with warts on, not because as you originally assumed you cannot
write object oriented code in C, but because it hasn't always been
implemented correctly.  Try for example calling gtk_tooltips_set_tip()
on a GtkToolItem object.  It should work, because GtkToolItem is derived
from GtkWidget, but in fact you need to call
gtk_tool_item_set_tooltip().

The same disjunction still appears to arise with the new
gtk_widget_set_tooltip_text() and gtk_tool_item_set_tooltip_text().

Yes I know why there are these separate functions for GtkToolItem
objects: the GtkToolItem version operates on the tool item's child
widget.  But the interface is broken from the OO perspective.  (It
could have been solved with the new tooltip interface by specialising
gtk_widget_set_tooltip_text() for tool item objects, but that does
appear to have been done.)

Chris


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