Re: RFC: Model-View-Controller



On Wed, Nov 16, 2011 at 9:37 AM, Kristian Rietveld <kris loopnest org> wrote:
> If there are multiple views, which are changed by which controller?  What complicates thinking about this for me is that in MVC as I know it, there is 1 Model, 1 View and 1 Controller for each "thing".
>
I  think this is where the misunderstanding is. I probably shouldn't
have mentioned MVC in the email and named it "actions and actors" and
just used the clutter terminology.
The whole idea has nothing to do with "classical" MVC.

It's all about splitting common interactions into separate objects -
like "click", "drag" or "rubberband" - that you can then the
controller would probably emit events that you can hook into if you
want or let it do its default thing (draw a blue selection rectangle)
if you don't want to. Of course, you want to connect to the "finished"
signal for events to update the widget.

The same thing for the view thing, it's more about making drawing
operations stateful and giving them objects. So instead of
gtk_render_background(), you'd instantiate a GtkBackground object and
it'd do whatever needs doing to get it onto the screen. It's not like
you'd write a GtkTreeViewView object that'd draw a treeview. That's
indeed kinda very useless.

Benjamin


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