[ANN] New keymapping on SqueakMap

David Shaffer cdshaffer at acm.org
Sun Dec 19 20:07:07 UTC 2004


Just thinking about how you could do it w/o modifying the Workspace 
class.  This code would add the category #Workspace to the PTM in the 
Workspace.  I'm sure you could do similar things with the Transcript etc:

win := Workspace new embeddedInMorphicWindowLabeled: 'Special KM'.
win applyModelExtent.
(win submorphOfClass: PluggableTextMorph) addKeymapCategory: #Workspace.
win openInWorld

This creates one Workspace with the keymap category #Workspace.  If you 
wanted to commit to this arrangement for all workspaces you would override:

Workspace>>embeddedInMorphicWindowLabeled: labelString
    | window plm |
    window := (SystemWindow labelled: labelString) model: self.
    plm := PluggableTextMorph on: self text: #contents accept: 
#acceptContents:
            readSelection: nil menu: #codePaneMenu:shifted:.
    plm addKeymapCategory: #Workspace.
    window addMorph: plm frame: (0 at 0 corner: 1 at 1).
    ^ window

I think subclasses of MorphicModel deserve some special keymapping 
behavior.  I am considering automatically using their model class name 
as one of their default categories.  In fact, MorphicModel's already get 
some special treatment from some of the action classes (the model is the 
target of the action instead of the morph itself).

David




More information about the Squeak-dev mailing list