smalltalk_r.rc
author Claus Gittinger <cg@exept.de>
Sun, 11 Feb 1996 13:49:20 +0100
changeset 84 06f58dd9b0ae
parent 23 cdbea135d4bf
child 121 0974ee733cf4
permissions -rw-r--r--
*** empty log message ***

"*
 * $Header$
 *
 * restart configuration for smalltalk
 *
 * this file plays the role of smalltalk.rc when an image
 * is restarted. Usually, everything should stay as it was,
 * except for things like keyboard mapping (if running on another display)
 *
 * notice, that all views and things have already been restored when this
 * script is run ....
 *"

"*
 * this handles all variant display stuff
 * (i.e. things which might change, when DISPLAY is set different)
 *"
Smalltalk fileIn:'display.rc'.


"*
 * this defines stuff relating to the machine we are running on
 * (which may also be different after a snapIn)
 *"
Smalltalk fileIn:'host.rc'.
!

"*
 * now, this is a nice one:
 *
 * if the image was saved on a different type of display, ask
 * user, if he/she'd like to have the style changed.
 *"
|depthChange colorChange greyChange reconfigure|

depthChange := false.
colorChange := false.
greyChange := false.

(Smalltalk includesKey:#'_ImageDisplayDepth') ifTrue:[
    depthChange := ((Smalltalk at:#'_ImageDisplayDepth') ~~ Display depth)
].
(Smalltalk includesKey:#'_ImageDisplayHasColor') ifTrue:[
    colorChange := ((Smalltalk at:#'_ImageDisplayHasColors') ~~ Display hasColors)
].
(Smalltalk includesKey:#'_ImageDisplayHasGreyscales') ifTrue:[
    greyChange := ((Smalltalk at:#'_ImageDisplayHasGreyscales') ~~ Display hasGreyscales)
].
(depthChange or:[colorChange or:[greyChange]]) ifTrue:[
    reconfigure := self confirm:'Display capabilities have changed

Do you want to reconfigure the view style ?'.

    reconfigure ifTrue:[
	Display knownViews do:[:aView |
	    aView notNil ifTrue:[
		aView reinitStyle.
	    ]
	].
    ].
].

Smalltalk at:#'_ImageDisplayDepth' put:Display depth.
Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors.
Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales.
!