[GUI] How to create objects and how to get/set their attributes

David Sankel camio@yahoo.com
Wed, 5 Mar 2003 16:13:03 -0800 (PST)


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