How to create objects and how to get/set their attributes

David Sankel <[email protected]>
Newsgroups gmane.comp.lang.haskell.gui
Message-ID <[email protected]>
Thanks to Wolfgang for sorting out the current
discussion topics.  I hope this to be the thread for 1
on the issue list.  There have been three, that I have
seen, competing ideas.

The first is the GIO/Object IO style of objects:

button <- Button [ title =: "Hello", position =:
(0,0), size =: (300,50) ]
set button [ onPress =: (buttonPressed button) ]
set parentWindow  [children ~= (/a -> button:a)]

The second is a motif style (please correct me if I
have this wrong):

button <- create "Button" parentWindow [ title =:
"Hello", position =: (0,0), size =: (300,50) ]
set button [ onPress =: (buttonPressed button) ]

The third is the OO approach

button <- new Button
button # setOnPress (buttonPressed button)
button # setPosition (0,0)
button # setSize (300,50)
parentWindow # addChild button

I propose we use the GIO/Object IO style.  Does anyone
have any other preferred styles that I'm missing? 
Which style do you prefer?

David J. Sankel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.