added an exitOnLastClose instVar flag. (smc requirement)
authorClaus Gittinger <cg@exept.de>
Tue, 10 Aug 1999 12:02:11 +0200
changeset 2818 d5453b85243d
parent 2817 3be0cda12180
child 2819 b6ec02c914ae
added an exitOnLastClose instVar flag. (smc requirement)
DevWorkst.st
DeviceWorkstation.st
--- a/DevWorkst.st	Thu Aug 05 13:36:56 1999 +0200
+++ b/DevWorkst.st	Tue Aug 10 12:02:11 1999 +0200
@@ -15,7 +15,7 @@
 		bitsBlue redMask greenMask blueMask redShift greenShift blueShift
 		hasColors hasGreyscales width height widthMM heightMM
 		resolutionHor resolutionVer idToTableIndexMapping knownViews
-		knownIds knownBitmaps knownBitmapIds dispatching dispatchProcess
+		knownIds knownBitmaps knownBitmapIds dispatching dispatchProcess exitOnLastClose
 		ctrlDown shiftDown metaDown altDown motionEventCompression lastId
 		lastView keyboardMap rootView isSlow activeKeyboardGrab
 		activePointerGrab buttonTranslation multiClickTimeDelta
@@ -26,9 +26,9 @@
 		clipBoardEncoding focusView'
 	classVariableNames:'ButtonTranslation MultiClickTimeDelta DeviceErrorSignal
 		DeviceIOErrorSignal DeviceIOTimeoutErrorSignal ErrorPrinting
-		DefaultScreen AllScreens ExitOnLastClose CurrentScreenQuerySignal
+		DefaultScreen AllScreens CurrentScreenQuerySignal
 		LastActiveScreen LastActiveProcess NoBeep
-		WindowsRightButtonBehavior'
+		WindowsRightButtonBehavior ExitOnLastClose'
 	poolDictionaries:''
 	category:'Interface-Graphics'
 !
@@ -96,6 +96,9 @@
       knownBitmapIds  <Collection>      corresponding device-bitmap ids
 
       dispatching     <Boolean>         true, if currently in dispatch loop
+      exitDispatchOnLastWindowClose
+		      <Boolean>         if true, dispatch is finished when the last
+					window closes (default:true).
 
       ctrlDown        <Boolean>         true, if control key currently pressed
       shiftDown       <Boolean>         true, if shift key currently pressed
@@ -136,12 +139,6 @@
 
       AllScreens                        a collectin of known screens
 
-      ExitOnLastClose                   if true, the dispatch process terminates when the
-					last view is closed. (for stand alone apps)
-					Should be set to false, if a standAlone app
-					closes all views and still needs an event dispatcher
-					later (i.e. is temporary view-less)
-
     [see also:]
 	GraphicsContext DeviceDrawable
 	WindowSensor WindowGroup WindowEvent
@@ -348,7 +345,6 @@
 	CurrentScreenQuerySignal notifierString:'asking for current screen'.
     ].
     ErrorPrinting := true.
-    ExitOnLastClose := false.
 
     self initializeConstants.
 
@@ -753,9 +749,13 @@
 
 exitOnLastClose:aBoolean
     "set/clear the flag which controls if the
-     event dispatching should stop when the last view is closed.
+     event dispatching should stop when the last view is closed
+     on the (main) Display connection.
      (standAlone applications will set it)"
 
+    "/ here, a separate class variable is used, since this may have
+    "/ to be set at init-time, when no display instance exists yet.
+    "/ For all other (non-main-Display) connections, an instVar is used.
     ExitOnLastClose := aBoolean
 
     "Modified: 23.4.1996 / 22:01:28 / cg"
@@ -3594,6 +3594,7 @@
     self == Display ifTrue:[
 	ExitOnLastClose ifFalse:[^ self].
     ].
+    exitOnLastClose ifFalse:[^ self].
 
     knownViews notNil ifTrue:[
 	(knownViews findFirst:[:slot | 
@@ -4540,6 +4541,18 @@
     "Created: 13.1.1997 / 22:10:07 / cg"
 !
 
+exitOnLastClose:aBoolean
+    "set/clear the flag which controls if the
+     event dispatching should stop when the last view is closed."
+
+    self == Display ifTrue:[
+	ExitOnLastClose := aBoolean
+    ].
+    exitOnLastClose := aBoolean
+
+    "Modified: 23.4.1996 / 22:01:28 / cg"
+!
+
 initialize
     "initialize the receiver for a connection to the default display"
 
@@ -6432,6 +6445,6 @@
 !DeviceWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.305 1999-07-12 12:34:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.306 1999-08-10 10:02:11 cg Exp $'
 ! !
 DeviceWorkstation initialize!
--- a/DeviceWorkstation.st	Thu Aug 05 13:36:56 1999 +0200
+++ b/DeviceWorkstation.st	Tue Aug 10 12:02:11 1999 +0200
@@ -15,7 +15,7 @@
 		bitsBlue redMask greenMask blueMask redShift greenShift blueShift
 		hasColors hasGreyscales width height widthMM heightMM
 		resolutionHor resolutionVer idToTableIndexMapping knownViews
-		knownIds knownBitmaps knownBitmapIds dispatching dispatchProcess
+		knownIds knownBitmaps knownBitmapIds dispatching dispatchProcess exitOnLastClose
 		ctrlDown shiftDown metaDown altDown motionEventCompression lastId
 		lastView keyboardMap rootView isSlow activeKeyboardGrab
 		activePointerGrab buttonTranslation multiClickTimeDelta
@@ -26,9 +26,9 @@
 		clipBoardEncoding focusView'
 	classVariableNames:'ButtonTranslation MultiClickTimeDelta DeviceErrorSignal
 		DeviceIOErrorSignal DeviceIOTimeoutErrorSignal ErrorPrinting
-		DefaultScreen AllScreens ExitOnLastClose CurrentScreenQuerySignal
+		DefaultScreen AllScreens CurrentScreenQuerySignal
 		LastActiveScreen LastActiveProcess NoBeep
-		WindowsRightButtonBehavior'
+		WindowsRightButtonBehavior ExitOnLastClose'
 	poolDictionaries:''
 	category:'Interface-Graphics'
 !
@@ -96,6 +96,9 @@
       knownBitmapIds  <Collection>      corresponding device-bitmap ids
 
       dispatching     <Boolean>         true, if currently in dispatch loop
+      exitDispatchOnLastWindowClose
+		      <Boolean>         if true, dispatch is finished when the last
+					window closes (default:true).
 
       ctrlDown        <Boolean>         true, if control key currently pressed
       shiftDown       <Boolean>         true, if shift key currently pressed
@@ -136,12 +139,6 @@
 
       AllScreens                        a collectin of known screens
 
-      ExitOnLastClose                   if true, the dispatch process terminates when the
-					last view is closed. (for stand alone apps)
-					Should be set to false, if a standAlone app
-					closes all views and still needs an event dispatcher
-					later (i.e. is temporary view-less)
-
     [see also:]
 	GraphicsContext DeviceDrawable
 	WindowSensor WindowGroup WindowEvent
@@ -348,7 +345,6 @@
 	CurrentScreenQuerySignal notifierString:'asking for current screen'.
     ].
     ErrorPrinting := true.
-    ExitOnLastClose := false.
 
     self initializeConstants.
 
@@ -753,9 +749,13 @@
 
 exitOnLastClose:aBoolean
     "set/clear the flag which controls if the
-     event dispatching should stop when the last view is closed.
+     event dispatching should stop when the last view is closed
+     on the (main) Display connection.
      (standAlone applications will set it)"
 
+    "/ here, a separate class variable is used, since this may have
+    "/ to be set at init-time, when no display instance exists yet.
+    "/ For all other (non-main-Display) connections, an instVar is used.
     ExitOnLastClose := aBoolean
 
     "Modified: 23.4.1996 / 22:01:28 / cg"
@@ -3594,6 +3594,7 @@
     self == Display ifTrue:[
 	ExitOnLastClose ifFalse:[^ self].
     ].
+    exitOnLastClose ifFalse:[^ self].
 
     knownViews notNil ifTrue:[
 	(knownViews findFirst:[:slot | 
@@ -4540,6 +4541,18 @@
     "Created: 13.1.1997 / 22:10:07 / cg"
 !
 
+exitOnLastClose:aBoolean
+    "set/clear the flag which controls if the
+     event dispatching should stop when the last view is closed."
+
+    self == Display ifTrue:[
+	ExitOnLastClose := aBoolean
+    ].
+    exitOnLastClose := aBoolean
+
+    "Modified: 23.4.1996 / 22:01:28 / cg"
+!
+
 initialize
     "initialize the receiver for a connection to the default display"
 
@@ -6432,6 +6445,6 @@
 !DeviceWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.305 1999-07-12 12:34:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.306 1999-08-10 10:02:11 cg Exp $'
 ! !
 DeviceWorkstation initialize!