logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Class/Object Hierarchy: msg#00013

Subject: Re: Class/Object Hierarchy
--- Wolfgang Thaller <wolfgang.thaller@xxxxxxx> wrote:
> So what have we already agreed on?
> 1) There will be a datatype Window

okay

> 2) There will be a datatype Pane

I don't think we need this datatype.  Since Windows
are not going to be widgets, we simply need Widgets
and Windows.

As for menu items, these seem to be more of an
attribute of a menubar than a widget itself.  This
also simplifies things.

I think we simply need Windows and Widgets.

> 3) ... along with a class IsPane (or PaneClass or
> ...)
>       class IsPane p where
>               toPane :: p -> Pane

This is similar to the IsWidget thing which I agree
too.

> 4) There will be a class Container
>       class Container c where
>               -- member functions to be determined
> And we'll have
> 4a) instance Container Window
> 4b) instance Container GridBox

>From a programmers perspective, having a Container
class is of little or no use.  This is especially true
since each container might have a different addChild
function. (see more comments below)

> 5) For a particular widget type Foo, we will have
> 5a) data Foo

okay

> 5b) instance IsPane Foo

I would prefer IsWidget

> 5c) newFoo :: Container c => c -> [Prop Foo] -> IO
> Foo

I do not like passing the parent to the constructor. 
<Prev in Thread] Current Thread [Next in Thread>