プログラム断片(2009/04/20)
for VisualWorks 7.6 with Jun776
| aRectangle anImage aWindow |
aRectangle := 200 @ 100 extent: 400 @ 300.
anImage := Graphics.Screen default completeContentsOfArea: aRectangle.
aWindow := UI.ApplicationWindow new.
aWindow label: 'My First Window'.
aWindow component: anImage.
aWindow openIn: aRectangle.
aWindow displayPendingInvalidation.
1.5 seconds wait.
32 timesRepeat:
[aRectangle := aWindow displayBox.
aRectangle := aRectangle translatedBy: 4 @ 3.
aWindow displayBox: aRectangle.
aWindow displayPendingInvalidation.
0.1 seconds wait].
^aWindow
 |
0.1秒毎に右下へと移動するよ…
|
|
| aRectangle anImage aWindow |
aRectangle := 200 @ 100 extent: 400 @ 300.
anImage := Graphics.Screen default completeContentsOfArea: aRectangle.
aWindow := UI.ApplicationWindow new.
aWindow label: 'My First Window'.
aWindow component: anImage.
aWindow openIn: aRectangle.
aWindow displayPendingInvalidation.
UI.InputState default cursorPoint: aRectangle topCenter.
1.5 seconds wait.
[UI.InputState default mouseButtons = 0] whileTrue:
[aRectangle := aWindow displayBox.
aRectangle := aRectangle align: aRectangle topCenter
with: UI.InputState default mousePoint.
aWindow displayBox: aRectangle.
aWindow displayPendingInvalidation].
^aWindow
 |
マウスボタンが押されていない間…
…ウィンドウがマウスに追随
|
|
for VisualWorks 7.6 with Jun776
Updated: 2019/08/24 (Created: 2009/04/20)
