Login  Register

Re: Question about Morphic in Pharo 4

Posted by kilon.alios on Dec 19, 2014; 7:45pm
URL: https://forum.world.st/Question-about-Morphic-in-Pharo-4-tp4796331p4796476.html

"Can you help me understand?"

sure take this simple example I want to add a button for choosing background color, I am giving you the list of my problems

1) If I want to initialise it I cant use the initialise method of my class (why ? ) I have to use initializeWidgets

2)  Inside initializeWidget I create an array that describes the name of each button but no that is not enough

3) I have also have to initialise seperately the button with self newButton but wait that is not enough

4) I have to define the action of the button the only step here that makes sense to me but even that is not enough

5) I have to create a method that returns the name of the button and to makes things even more verbose

6) I have to define a method at the class side for positioning the button . No idea why this goes to the class side

And all that so I can say to Spec take this button which has this label and will trigger this method and put it in that place. Java Swing is not that verbose. 

Generally I dont like this approach that I need to generate so many method and so many steps to define something so simple. 

So what happens right now is that I have a very simple GUI with 7 buttons and 6 moprh that i use to display colors , guess how many methods my class has . 

36 !!!

By the way in case you wonder 90% of the code is just Spec. For me thats plain unacceptable. 

So what happens if I have a GUI with over 100 buttons do I need 300 methods just for Spec ? Really ??