Two Squeak Window Questions
Andreas Raab
raab at isgnw.cs.Uni-Magdeburg.DE
Tue Feb 10 17:42:01 UTC 1998
Mark,
> Is there a way to kill a Window in Squeak without using the close
> button?
Send the message StandardSystemController>>closeAndUnschedule to the
window's controller. Here is a simple doIt for killing a window you are
pointing at:
| ctrlToKill |
"Wait for mouse click"
[Sensor redButtonPressed] whileFalse.
ctrlToKill _ ScheduledControllers scheduledControllers
detect:[:ctrl| ctrl viewHasCursor] ifNone:[nil].
"Don't kill the ScreenColler (wouldn't work anyways)"
ctrlToKill = ScheduledControllers screenController ifTrue:[^self].
ctrlToKill ifNotNil:[
(Utilities confirm:'Kill ', ctrlToKill view label)
ifTrue:[ctrlToKill closeAndUnschedule]]
> Second, is there any way to open two MVC windows in a method? When I send
> "open" to a controller, it terminates the current process.
StandardSystemController>>openNoTerminate is actually the right way to go.
Maybe you just didn't restore the screen correctly. Here is an example
of what I do in such cases:
(BrowserView browser: Browser new editString: nil) controller openNoTerminate.
(BrowserView browser: Browser new editString: nil) controller openNoTerminate.
ScheduledControllers restore.
Processor terminateActive
Hope this helps,
Andreas
--
Linear algebra is your friend - Trigonometry is your enemy.
+===== Andreas Raab ============= (raab at isg.cs.uni-magdeburg.de) =====+
I Department of Simulation and Graphics Phone: +49 391 671 8065 I
I University of Magdeburg, Germany Fax: +49 391 671 1164 I
+=============< http://isgwww.cs.uni-magdeburg.de/~raab >=============+
More information about the Squeak-dev
mailing list
|