showBanner.rc
author Claus Gittinger <cg@exept.de>
Mon, 14 Feb 2000 15:31:04 +0100
changeset 430 c2c69e841970
parent 429 dd966cdbe81f
child 431 c8a095f71ab4
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"/
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
"/ $Header$
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"/
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
"/ MIMEType: application/x-smalltalk-source
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
"/
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
"/ if you dont like the splash banner at startup,
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
"/ simply remove or rename this file.
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
"/
430
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
     9
"/ if you like another image to be shown (especially for applications),
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    10
"/ copy this file to the apps startup directory, 
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    11
"/ and edit the bitmap-file names found below as required.
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    12
"/
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    13
"/ Notice:
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    14
"/   the image used here was bought by ObjectShare from Robert Tinney
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    15
"/   and placed into the Public Domain by ObjectShare.
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    16
"/   We would like to thank both for that.
c2c69e841970 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
    17
"/   Feel free to use & spread it.
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    19
|d imgFileName img view|
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
420
0375b64c2a10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
    21
"/ for now: cannot do this under DOZE;
0375b64c2a10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
    22
"/ win does not support viewBackgrounds and
0375b64c2a10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
    23
"/ no event handling takes place at this time. sigh.
0375b64c2a10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
    24
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    25
(OperatingSystem isUNIXlike
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    26
and:[Display notNil]) ifTrue:[
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    27
    "/ choose one of the banners
427
Claus Gittinger <cg@exept.de>
parents: 422
diff changeset
    28
    "/ (select the one which fits our screen depth best,
Claus Gittinger <cg@exept.de>
parents: 422
diff changeset
    29
    "/  avoiding allocation of too many colors)
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    30
    (d := Display depth) <= 8 ifTrue:[
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    31
	d <= 4 ifTrue:[
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    32
	    d <= 2 ifTrue:[
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    33
		imgFileName := 'banner1.xpm'     "/ bw image
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    34
	    ] ifFalse:[
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    35
		imgFileName := 'banner3.xpm'     "/ 8 colors
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    36
	    ]
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
	] ifFalse:[
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    38
	    imgFileName := 'banner5.xpm'         "/ 24 colors
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    39
	].
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    ] ifFalse:[
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    41
	imgFileName := 'banner8.xpm'             "/ 255 colors
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    ].
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    44
    img := Image fromFile:imgFileName.
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    45
    img notNil ifTrue:[
429
dd966cdbe81f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 427
diff changeset
    46
	('showBanner.rc [info]: launch splash screen banner.') infoPrintCR.
422
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    47
	"/ remember the bannerView - will be destroyed by
22b0834a760a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    48
	"/ the hideBanner script.
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    49
	Smalltalk at:#'__BannerView__' put:(view := PopUpBanner forImage:img).
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    50
	view showCentered.
421
5758ae881cc1 *** empty log message ***
ca
parents: 420
diff changeset
    51
	Display flush.
419
5e539a896aad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    52
    ].
416
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
].
b97097ff3702 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!