[Q] [Morphic] Multiple Selections in PluggableListMorph?

Stephan B. Wessels swessels at one.net
Fri Apr 5 15:21:48 UTC 2002


I'm not real clear on what you've tried already but it you are searching for
an existing example within Squeak of a list pane that allows multiple
selections, try this...

>From the World menu select the "changes..." menu,
>From that Changes menu select "recently logged changes...",
That will pop up a menu named "Browser as far back as...",
>From there select an entry near the bottom of the list (to get a pane with
many changes in it).  For this example it does not matter if you choose a
list entry that begins with "SNAPSHOT" or "QUIT",
After a few seconds while Squeak scans through your changes file a window
named "Recent changes" will appear.

That window has an example of a multiple select list.  Just click one on any
item to select it.  Click on the same item again to deselect it.

(Be careful what you do here since you can now cause changes to your image
by file-in of these selected changes).

The window is using the PluggableListMorphOfMany.  For a code example look
at the instance methods on the class ChangeList.  Start by looking at the
method #openAsMorphName:multiSelect:

I checked this using Squeak 3.2gamma update #4811.

Hope that helps,

 - Steve

On 4/5/02 9:55 AM, "Ken G. Brown" <kbrown at tnc.ab.ca> wrote:

> Something seems amiss. If I open a ChangeSorter, in the upper left
> pane, no matter what I do, I can't get the highlighting to extend
> more than one item. At the moment this is with 3.3a-4816 on Mac
> Squeak 3.2.6Beta8.app VM. I was also seeing this at work on W2000,
> 3.3a-4816. Will check further when I get in.
> Ken
> At 15:05 +0200 on 2002/04/05,  Joern Eyrich is rumored to have written:
>> er, ... seems I should have taken a closer look... maybe shift has
>> nothing to do with it at all...
>> it seems to me to be like this:
>> you can select/deselect (an arbitrary subset of) individual items by
>> just clicking on them.
>> if you click on an item and drag the cursor without releasing the
>> button, all items that are "hit" by the cursor are either selected
>> or deselected (depending on whether you started on a deselected or a
>> selected item, respectively). I say "items that are hit" because it
>> seems that if you move the cursor fast enough that sometimes items
>> you move over are left unchanged.
>> Joern
>> Joern Eyrich wrote:
>>>  Ken,
>>>  Shift-Click is for *de*selection. I was stumped by this, too.
>>>  You can select multiple entries by clicking them individually or
>>> dragging over them.
>>>  Deselection is with shift-click or shift-drag.
>>>  Look in class ChangeList for an example of its usage (seems to be
>>> the only place in my 3.2g-4743 image).
>>>  Try for example "ChangeList browseRecent: 5000".
>>>  HTH,
>>>  Joern

More information about the Squeak-dev mailing list