'numberToken' {numberToken value asNumber} ;
やはり動かない。。。
[済]エクスプローラに alt+i ショートカットをつける
PluggableListMorph や SimpleHierarchicalListMorph でキーが押された時、デフォルトで #arrowKey:from: がモデルに送られる。
'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 16 July 2003 at 11:57:55 am'!
!ObjectExplorer methodsFor: 'as yet unclassified' stamp: 'tak 7/16/2003 11:53'!
arrowKey: aChar from: view
(Inspector
inspect: currentSelection withoutListWrapper) toggleIndex: 1;
inspectorKey: aChar from: view
! !
!ObjectExplorer methodsFor: 'as yet unclassified' stamp: 'tak 7/16/2003 11:46'!
explorerFor: anObject
| window listMorph |
rootObject _ anObject.
window _ (SystemWindow labelled: self label) model: self.
window addMorph: (listMorph _ SimpleHierarchicalListMorph
on: self
list: #getList
selected: #getCurrentSelection
changeSelected: #noteNewSelection:
menu: #genericMenu:)
frame: (0@0 corner: 1@0.8).
window addMorph: ((PluggableTextMorph on: self text: #trash accept: #trash:
readSelection: #contentsSelection menu: #codePaneMenu:shifted:)
askBeforeDiscardingEdits: false)
frame: (0@0.8 corner: 1@1).
listMorph autoDeselect: false.
^ window! !
[済]問題: ある値を常にモニタするテキストの作り方
(InfoStringMorph on: [Time millisecondClockValue]) openInWorld
[済]step の仕組み
Morph>>openInWorld の際に、
PasteUpMorph>>startStepping: が呼ばれ、その際実行メッセージとして #stepAt: が登録される。
この情報は StepMessage にカプセル化される。
StepMessage
scheduledAt: 次に実行される時刻 (Time millisecondClockValue 形式)
stepTime: ステップ間隔、nil なら対象モルフの stepTime が呼ばれる
receiver: 対象モルフ
selector: 対象メッセージ
arguments: 引数(なければnil
WorldState>>runLocalStepMethodsIn が World 内の StepMessage のリスト(ヒープ)から一つ取り出し、
Morph>>stepAt: が Morph>>step や Player>>stepAt: を呼び出す。
SystemWindow>>stepAt: ならモデルの stepAt:in: を呼び出す(インスペクタで使う)
もう少し詳しく step の動作をカスタマイズしたい場合
Morph>>startStepping:at:arguments:stepTime: を使う
例: self startStepping: #update: at: Time millisecondClockValue arguments: #(getListSel) stepTime: 10
(10ミリ秒ごとに、self update: #getListSel が実行される)
SystemWindow の場合は model にも更新の設定をかける
Object>>stepTimeIn: 更新間隔
Object>>stepAt:in: 実行内容
をオーバーライドする
注意点: step 機能は world に登録された後でないと動かない
[済]リストを使って現在のヒープを分かりやすく表示してみよう
上記の機能を駆使して作ったもの。ヒープと言うのはあらかじめソートされてある
能率の良いコレクションの事です。
StepList.st
[済]インスペクタの仕組み
Morphic 環境において、インスペクタは特定の間隔でずっとその対象を
観察しつづけている。上記 Object>>stepTimeIn: Object>>stepAt:in: の仕組みを利用している
selectionUpdateTime 文字列の場合は0, 複雑なオブジェクトの場合は前回表示に費やした時間(Inspector>>toggleIndex:)
更新は self changed: #contents から PluggableTextMorph>>update: によって行われる。
ここで、changed: の引数と同じ名前のメッセージがモデルに送られる。
[未]エクスプローラに alt+i ショートカットをつける
[未]色名と色の対応表 Color なんとか
2003-07-14
- VM プリミティブ http://minnow.cc.gatech.edu/squeak/2105
- ショートカットキー定義を加える方法
- Sensor は EventSensor のインスタンス
- stepping の仕組み(インスペクタ)
キーバインディングの勉強
ローカルに swiki
ツリー状にブラウズできるシステム
stepping?
インスペクタの動きを調べる
しょっちゅう値が変わるモルフ ClockMorph をインスペクトしてみる。
Inspector openAsMorphOn: (ClockMorph new) withLabel: 'test'
Inspector のインスタンス変数
contents: 表示内容文字列
object: 表示対象オブジェクト
selectionIndex: 選択中の場所
WorldState の stepList に実行すべき命令が書いてある
WorldState>>stepListSortBlock が優先順位を決める?
自分用ファイル置き場2
Link to this Page
- 言語ゲーム last edited on 19 March 2005 at 2:04:01 pm by 192.168.0.8