I'm quite new to Smalltalk and I've been searching a whole day how I could write a GUI. I've found loads of information on how to work with Morph
s and what Halo
s are, but I don't seem to be able to find what I need (It's only a table with the entries from a Dictionary
).
Next to Morphs
, I also found quite something on how smalltalk introduced the MVC-principle. I even found the ST-80 Views
Category, containing everything I would need, but again I am not sure on how to use it correctly and somehow I don't seem to find the right sources to get me started.
Therefore my question(s): Where to start to build a simple GUI? How should I choose from the billion Morph
s available and how do I combine them to a solid interface? Should MVC only be used when it gets more complex or are they also useful for simple GUIs? Is there any general overview on what to use in which cases?
To illustrate what I would like to do, I added some pseudo-code of how I would have it in mind:
d := Dictionary new.
"add data to the dictionary..."
view := DictionaryView new.
view addDictionary: d.
button := SimpleButtonMorph new.
"e.g. change label to sum of values"
button target: [button label: d sum.].
window := SystemWindow labelled: test.
window addMorph: view.
window addMorph: button.
Any help to get me started with this is highly appreciated.
Update:
I recently found a chapter from a book that helped me understand morphic better with some nice explanation and example code and for people who want to know more, there is a whole list of free books too. Also useful were the tutorials from the squeak wiki. Especially the one on Pluggable Morphs
helped me to understand this concept better. Note that this tutorial is hidden in the list of unreviewed tutorials (possibly because there is a little error in the project that can be downloaded).
buildWith
, but they all seem to usebuildWindowWith
which I don't seem to find (can one find methods by name in the system browser?). Concerning the Plain morphs: Does this mean that the outer layer should always be a widget containing morphs for everything I would like to be shown in a single window? – Rickart