PopUpChoiceMorph Candidate for Extinction?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PopUpChoiceMorph Candidate for Extinction?

JohnReed Maffeo
#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)

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?

jrm

Reply | Threaded
Open this post in threaded view
|

Re: PopUpChoiceMorph Candidate for Extinction?

David T. Lewis
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


Reply | Threaded
Open this post in threaded view
|

Re: PopUpChoiceMorph Candidate for Extinction?

timrowledge
In reply to this post by JohnReed Maffeo

On 30-12-2013, at 11:31 AM, JohnReed Maffeo <[hidden email]> wrote:

> #PopUpChoiceMorph looked like the logical choice for me to use in an application I am building.

Wow, yet *another* menu related class? That’s what, 42?

I think maybe, perhaps, just possibly, we should consider this as a target for drastic simplifimicisation for the next release.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: XM: Exclusive Maybe



Reply | Threaded
Open this post in threaded view
|

Re: PopUpChoiceMorph Candidate for Extinction?

JohnReed Maffeo
In reply to this post by JohnReed Maffeo
> ----- Original Message -----
> From: David T. Lewis
> Sent: 12/30/13 04:13 PM
> To: The general-purpose Squeak developers list
> Subject: Re: [squeak-dev] PopUpChoiceMorph Candidate for Extinction?
>
> 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

Thanks,
I guess there is no "best". I spent several hours today trying to figure out
how to use the class in my app. It was not obvious where it was used
in #EnvelopeEditorMorph, but I eventually saw it. It was hiding in a plain text
field in the same font as several other dispaly only Morphs in the display space.

Since ToolBuilder is so widely used, I think I will take a look at it. (I am
after all trying to build a tool;) I am not tied to Morphic, I just want to
get something that works.

johnreed