
[redirected to gui@haskell.org]
Juan Carlos Arévalo Baeza
On Tue, 25 Sep 2001 17:41:06 +1000, Manuel M. T. Chakravarty wrote:
Many applications where GUIs are used require a canvas/scribble field with the following basic functionality:
- set a point in a particular color; if speed is an issue, mapping a 2D-array content to the canvas would be useful
Sure - such functionality needs to be included. However, a canvas widget is just one among many.
IMHO, the main interest on having this kind of functionality singled out is that this allows any other drawing primitive to be implemented in a generic way. You wouldn't have fast implementations, but this will allow complete implementations of the drawing portion of the GUI to be done real quickly, and it would also provide a reference implementation for all the basic drawing primitives. Any implementation that uses hardware acceleration or that defers rendering of primitives to the operating system can then be checked against that reference implementation.
Facilities for extension is certainly a good thing to have. And it doesn't necessarily mean that such extensions need to be slow. The architecture of GTK+ (at least, the C API) is a good example of how the real implementation of all widgets can actually be based on one generic mechanism. It would be very interesting to see how far this approach could be transferred to Haskell. Manuel