[BUG] SimpleHierarchicalListMorph does notunderstand#getCurrentSelectionIndex

Andreas Raab andreas.raab at gmx.de
Tue Jun 29 22:28:13 UTC 2004


Ned,

I disagree - if a key stroke selector has been set it should be called no
matter what and the client (model) is then responsible to call #arrowKey: if
it wants to. That's because otherwise you've got a heck of a time
(subclassing an arbitrary number of classes) if you ever want to be able to
have "non-standard" responses to arrow keys.

Cheers,
  - Andreas

----- Original Message ----- 
From: "Ned Konz" <ned at bike-nomad.com>
To: <squeak-dev at lists.squeakfoundation.org>
Cc: <chris at funkyobjects.org>; "Andreas Raab" <andreas.raab at gmx.de>
Sent: Tuesday, June 29, 2004 3:01 PM
Subject: Re: [BUG] SimpleHierarchicalListMorph does
notunderstand#getCurrentSelectionIndex


> On Tuesday 29 June 2004 10:39 am, Andreas Raab wrote:
> > Try changing the last line in ObjectExplorer>>explorerKey:from: from
> >
> >     ^ self arrowKey: aChar from: view
> >
> > to
> >
> >     ^ view arrowKey: aChar
>
> Of course, this brings up the question of why the callbacks work
differently
> in the PluggableListMorph, (versus the SimpleHierarchicalListMorph, and
the
> PluggableListView).
>
> In the PLM, the model is NEVER called for any un-modified arrow keys, just
for
> keys with modifiers (shift, alt, command, control?). The model never hears
> about keys whose asciiValue is < 32.
>
>
> Browser(Model)>>arrowKey:from:
> [...]
> PluggableListMorph>>modifierKeyPressed:
> model perform: keystrokeActionSelector
> with: aChar
> with: self
> PluggableListMorph>>keyStroke:
> | aChar aSpecialKey |
> (self scrollByKeyboard: event) ifTrue: [^self].
> aChar _ event keyCharacter.
> aSpecialKey _ aChar asciiValue.
> aSpecialKey < 32 ifTrue: [^ self specialKeyPressed: aSpecialKey].
> (event anyModifierKeyPressed or: [self handlesBasicKeys not])
> ifTrue: [^ self modifierKeyPressed: aChar].
> ^ self basicKeyPressed: aChar
>
>
> So none of the code in Model>>arrowKey: is ever executed from the PLM.
>
> It could be moved into PLV and replaced with an empty method. It should
> *really* be called something like #commandKey: instead.
>
> In the SHLM and the PLV, the model is always called if it set a
> keystrokeSelector. Which means that if you want to get a real arrow key
> action, you have to call *back* to the SHLM...
>
> ObjectExplorer>>explorerKey:from:
> SimpleHierarchicalListMorph>>keyStroke:
> | args aCharacter |
> (self scrollByKeyboard: event) ifTrue: [^self].
> aCharacter := event keyCharacter.
> keystrokeActionSelector isNil ifTrue: [^self arrowKey: aCharacter].
> ^model perform: keystrokeActionSelector with: aCharacter.
>
>
> Stay tuned for a fix...
> -- 
> Ned Konz
> http://bike-nomad.com
>
>




More information about the Squeak-dev mailing list