[UI] ToolBuilder
tim Rowledge
tim at rowledge.org
Mon Sep 10 22:13:14 UTC 2007
On 10-Sep-07, at 12:44 PM, Igor Stasenko wrote:
> After 20 years of progress we finished up with following:
>
> ScrollPane subclass: #PluggableTextMorph
> instanceVariableNames: 'textMorph getTextSelector setTextSelector
> getSelectionSelector hasUnacceptedEdits askBeforeDiscardingEdits
> selectionInterval hasEditingConflicts'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Morphic-Pluggable Widgets'
Up to hasUnacceptedEdits it seems perfectly reasonable to me, though
I can't quite see why a textmorph needs an instvar for a textmorph...
a)getTextSelector is the message you send to the model to get the
text to display. Nothing odd or objectionable about that surely? You
*could* have it hardcoded and use an adaptor wotsit.
b)setTextSelector is the message used to tell the model to deal with
edited text being accepted by the user. See above.
c) getSelectionSelector is the message used to ask the model for
where the current selection should be; I assume this is mostly of use
when wanting to highlight a message name in a message browser of
perhaps when searching.
What is odd, bad, or sarcasm-worthy about those?
The latter instvars seem to me to be symptoms of trying to make the
class do too much instead of subclassing for the more complex usages.
Also remember that there is nothing stopping one using an adaptor of
some sort along with the pluggable selectors if you need more
sophisticated intermediation. You can set the three selectors to
vale, value: and selection and have your adaptor do the rest. In
simple (normal) cases you just use the inbuilt adaptor capability.
tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
My Go this amn keyboar oesn't have any 's.
More information about the UI
mailing list