Re: [gtk-list] Re: Widgets Vs Gadgets (Was : map/unmap optimization)



> julian.gosnell@nomura.co.uk wrote:
> >In the best GUI toolkits that I have seen, widgets do not hold data at all,
 they
> > simply call back to the user (probably with a clipped window or pixmap) when
> > they need the data drawn, the user draws the data however they feel like
 doing
> Sound like MVC.  Which toolkit does things this way?

XmDrawnList for Motif (I think it's part of something called Xm+). Calls back to
 the user with a pixmap to draw each item in.

Swing works like this (they provide a data Model interface, you inherit from
 this and can store your data in any format you like - then the GUI component
 just hooks to the model and redraws whatever it wants, whenever it wants), and
 I came across another Java toolkit that had a table widget that worked like
 this (I can't remember the name off-hand but I went to the presentation and was
 impressed)

MVC, is a paradigm for decoupling data models from parties interested in
 altering their values, or alterations to their values, or both, which you would
 use to e.g. avoid clumsy relationships between your data and GUI. 

The two design patterns are not the same thing, but are complimentary
 technologies and bound so closely together in toolkits like Swing as to
 possibly become confused with each other.

In conclusion I would want both - and although my experience of Swing is limited
 it seems to be pretty well designed (I could could wrap this thread around to
 swallow its own tail here by asking why Swing now uses lightweight/windowless
 components, but I shall resist that temptation).


Jules



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