[squeak-dev] PopUpChoiceMorph Candidate for Extinction?

David T. Lewis lewis at mail.msen.com
Mon Dec 30 23:13:37 UTC 2013


On Mon, Dec 30, 2013 at 02:31:09PM -0500, JohnReed Maffeo wrote:
> #PopUpChoiceMorph looked like the logical choice for me to use in an application I am building. When I went to learn how to use it, I used World - newMorph - from alphabetical list - P-R and selected PopUpChoiceMorph. When I selected a color from the list, I got "Error: Instances of Set are not indexable". This is a bug caused by #initalize being used to create a usable example for newMorph and getting a set rather that and array returned from its target (#Color)
> 

Color class>>colorNames used to answer an OrderedCollection, but now it
answers a Set. I updated PopUpChoiceMorph>>mouseDown: to convert it to
the expected ordered collection.

> As I researched the problem, I found that the method is only used in two classes: EnvelopeEditorMorph and ScorePlayerMorph. This makes me think that it maybe a candidate for extinction or it may be a good Morphic solution that is not used very much.
> 
> The popup menu (a PluggableSystemWindow)that is presented when performing a findClass from the System Browser category pane looks (and performs?) similar to PopUpChoiceMorph, so my question is, should I use one over the other?
> 

The dialog that you see in the browser is a ListChooser. This is part of
the ToolBuilder framework. I cannot say which is the best to use. Using
ToolBuilder is generally a good thing, but you may find it simpler to use
PopUpChoiceMorph if you expect your application to always run in Morphic.

Dave



More information about the Squeak-dev mailing list