showBanner.rc
author Claus Gittinger <cg@exept.de>
Mon, 14 Feb 2000 15:29:28 +0100
changeset 429 dd966cdbe81f
parent 427 b0dcafaa39b4
child 430 c2c69e841970
permissions -rw-r--r--
*** empty log message ***

"/
"/ $Header$
"/
"/ MIMEType: application/x-smalltalk-source
"/
"/ if you dont like the splash banner at startup,
"/ simply remove or rename this file.
"/
"/ Notice: the image used here was bought by ObjectShare from Robert Tinney
"/ and placed into the Public Domain by ObjectShare.
"/ We would like to thank both for that.
"/ Feel free to use & spread it.

|d imgFileName img view|

"/ for now: cannot do this under DOZE;
"/ win does not support viewBackgrounds and
"/ no event handling takes place at this time. sigh.

(OperatingSystem isUNIXlike
and:[Display notNil]) ifTrue:[
    "/ choose one of the banners
    "/ (select the one which fits our screen depth best,
    "/  avoiding allocation of too many colors)
    (d := Display depth) <= 8 ifTrue:[
	d <= 4 ifTrue:[
	    d <= 2 ifTrue:[
		imgFileName := 'banner1.xpm'     "/ bw image
	    ] ifFalse:[
		imgFileName := 'banner3.xpm'     "/ 8 colors
	    ]
	] ifFalse:[
	    imgFileName := 'banner5.xpm'         "/ 24 colors
	].
    ] ifFalse:[
	imgFileName := 'banner8.xpm'             "/ 255 colors
    ].

    img := Image fromFile:imgFileName.
    img notNil ifTrue:[
	('showBanner.rc [info]: launch splash screen banner.') infoPrintCR.
	"/ remember the bannerView - will be destroyed by
	"/ the hideBanner script.
	Smalltalk at:#'__BannerView__' put:(view := PopUpBanner forImage:img).
	view showCentered.
	Display flush.
    ].
].
!