=== Top of the Swiki === Attachments ===

KillTheWindow

MarkGuzdial

Is there a way to kill a window in Squeak without using the close button?

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]

-- AndreasRaab