Flawed design?




Hi.

The tutorial says that there are a bunch of dialogs
that "derive" from GtkWindow (e g the ColorSelection
dialog). Now I assume that "derive" in this context
means the same as it does in regular objectoriented
design, that is that a ColorSelection dialog IS-A
Window. This implies that I should be able to use a
ColorSelection dialog whereever I can use a GtkWindow
or even a GtkContainer which is a ancestor of
GtkWindow.

I find that this is not the case. I can add a widget
to a container (via gtk_container_add) but I cannot
do the same to a ColorSelection dialog which I
should be able to do since it IS-A container.

My point is that I think that the widget hierarchy
is flawed. The ColorSelection dialog (and probably
the other dialogs too - I haven't checked them)
should not derive from GtkWindow. They should not
even derive from GtkContainer. They should possibly
derive from GtkWidget.

There is a difference between "IS-A window" and
"HAS-A window".

Regards,
Per Erik Stendahl, CS student



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