links to this page:
Squeak bons mots
Swiki Page List
MVC: kill a window
Last updated at 3:32 pm UTC on 14 January 2006
Q:
Is there a way to kill a window in Squeak without using the close button?
Mark Guzdial
A:
Here is a doIt which kills the window you're pointing at:
| ctrlToKill |
"Wait for mouse click"
[Sensor waitButton; redButtonPressed] whileFalse.
ctrlToKill _ ScheduledControllers scheduledControllers
detect: [:ctrl | ctrl viewHasCursor]
ifNone: [^self].
ctrlToKill = ScheduledControllers screenController ifTrue: [^self].
(Utilities confirm: 'Kill ', ctrlToKill view label)
ifTrue: [ctrlToKill closeAndUnschedule]
Andreas Raab