On Tue, Aug 03, 2004 at 09:23:24PM +0100, Matthew Walton <matthew alledora co uk> wrote: > Andreas Pokorny wrote: > > >On Tue, Aug 03, 2004 at 02:48:47PM +0100, Matthew Walton > ><matthew alledora co uk> wrote: > >>What you appear to be wanting here is a seperation of data and > >>presentation (or Model-View-Controller), which is a fairly classic > >>concept from all sorts of places. You should find that the TreeView > > > > > >Yes, thats what I want, but I would hate an interface in which I had to > >derive from some base model class just to wrap the model of a text field. > >Then again you would have to write a lot of interface code to "get your > >data into the gui". > > I propose a system that works without strong coupling of Gui classes > >and user classes, and more important than that, a system which saves a > >lot of lines of code. > > Gtk::TreeModel is really just an interface - it's there to ensure that > all models have the required methods available for Gtk::TreeView to call > to get what it expects. That's not a particularly onerous thing. I like the TreeModel, maybe the interface is a bit strange to implement, but still it allows a lot of freedom for developers. I just wanted to say that I would not like to have to implement a certain interface to provide a model for simpler widgets. Although having that kind of model separation in all widgets would allow me generating classes which derive from the model base classes, and which provide the property based interface. > Are you thinking of something where instead of providing a model object > to the TreeView, you instead get the TreeView to call your own supplied > functions or methods to obtain its data? If so, that's really just a > different way to the same end (probably a messier one in my opinion). If > you're thinking of something else, I'd be interested to hear you explain it. I do not think that it is messier, instead it simplifies everything. It is like the signal slot concept, which is an observer pattern implementation without inheritance in the user code. After initializing the property, the widget and connecting both,the system keeps in synch on its own. And you still can react on signals or do your own processing. So I guess, I will try to get a simple Gui library working that implements that idea. Regards Andreas Pokorny
Attachment:
pgpa0aDyvyEXz.pgp
Description: PGP signature