Re: [gtk-list] Re: GtkEtext overview and: GTK_WIDGET_SET_FLAGS inheritance?




Paul Barton-Davis <pbd@op.net> writes: 
> Note that in a full-blown MVC model, there would be controllers as
> well as views; you've folded the V and the C together, which is OK as

The Java URL I was trying to find describes the Java "Model-Delegate"
system, where the "Delegate" is a merged controller and view. I think
this makes sense for most GUI components.

Derek the problem with your design is that the buffer isn't a widget;
GtkEditable is a widget. Thus the buffer is not a GtkEditable. You
can't derive from it. If you had an abstract Editable interface
separate from the EditableWidget interface, you could do what you
want, but GTK 1.2 doesn't have interfaces.

Look at my GtkTextView/GtkTextBuffer, that's about the only way to
implement this with single inheritance. The user only wants to
manipulate the buffer anyway; changing text via the view is broken,
because you are affecting all views, even views that aren't widgets
(the Undo history might be a view for example). Note that a "view"
doesn't have to be on the screen, it's just something that responds to
changes in the model. Having the model interface on the widget might
seem convenient but it doesn't make any sense conceptually.

Havoc




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