[comp.sys.mac.programmer] Control Panel problem with custom 'wctb'.

earleh@eleazar.dartmouth.edu (Earle R. Horton) (06/03/89)

I am at a loss to explain the following behavior.  The problem is to
change the default window colors on a Mac II by changing the 'wctb'
number zero resource in the System file.  I have a Mac II with an
Apple color monitor and Apple video card with the upgrade kit for 256
colors.  I generally run it in 16-color mode, set for "Color" rather
than for "Black & White/Grays."  System version is System Tools 6.02.
I replaced the 'wctb' resource in my System file with the one
described below.

derez "{systemfolder}"system types.r -only wctb
resource 'wctb' (0, "Main window color table") {
	0x0,
	0,
	{
		wContentColor, 55535, 65535, 65535,
		wFrameColor, 0, 0, 65535,
		wTextColor, 0, 15535, 0,
		wHiliteColor, 0, 0, 65535,
		wTitleBarColor, 65535, 65535, 0
	}
};

Among other things, this is supposed to give me a yellow title bar on
all my windows which have the standard title bar.  And so it does,
with the exception of the Control Panel's dialog window title bar,
which is always stubbornly white.  I tried this with a floppy copy of
the System Tools 1 disk from the 6.02 distribution, with my custom
'wctb' installed and with the same result: All title bars are yellow
when in 16-color or 256-color mode, except for the Control Panel's
which is white.  That experiment seems to eliminate the possibility of
conflict with INITs and things, since the only non-Apple thing on the
floppy startup disk is my non-standard 'wctb'.  This also happens with
System Tools 5.0.

Why?

"People forget how fast you did a job, but they remember how well you
did it."  Salada Tag Lines

wilson@ji.Berkeley.EDU (James E. Wilson) (06/04/89)

In article <13760@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu (Earle R. Horton) writes:
>I am at a loss to explain the following behavior.  The problem is to
>change the default window colors on a Mac II by changing the 'wctb'

>all my windows which have the standard title bar.  And so it does,
>with the exception of the Control Panel's dialog window title bar,

The control panel is a dialog, and the control panel just happens to have a
dctb resource which forces all of its window's colors to white and black.

The dctb resource owned by the Control Panel takes precedence over the
system default wctb resource, and hence you get a black and white control
panel window.  If you want a color window, you will have to delete the control
panel's dctb resource first (or edit it for color).

If you do this, though, you will find that your control panel no longer works.
For some reason, the General cdev crashes when you mess with the default window
colors.  If you have hierMenu init, and choose any cdev except General,
you will see a color window.  If you forget and choose General, then the
system crashes, and you must reboot (ES/RS/etc don't work).
This bug with the General cdev must be why the dctb was included in the
first place.  Unless you never use the General cdev, you will have to live
with the black and white control panel window.



Jim Wilson                          | And if a man tried to spend his time on 
Internet: wilson@ernie.Berkeley.EDU | earth, to show before he died, what one
Usenet:  ...!ucbvax!ucbernie!wilson | man's life could be worth, yes, I wonder
                                    | what would happen to this world.

earleh@eleazar.dartmouth.edu (Earle R. Horton) (06/04/89)

In article <29453@ucbvax.BERKELEY.EDU> wilson@ji.Berkeley.EDU.UUCP
	(James E. Wilson) writes:
...
>The dctb resource owned by the Control Panel takes precedence over the
>system default wctb resource, and hence you get a black and white control
>panel window.  If you want a color window, you will have to delete the control
>panel's dctb resource first (or edit it for color).
>
>If you do this, though, you will find that your control panel no longer works.
>For some reason, the General cdev crashes when you mess with the default window
>colors.

     Editing the 'dctb' resource seems to have no ill effect, at least
with Control Panel 3.3.1 (System Tools 6.02) and with Control Panel
3.2 (System Tools 5.0).  Removing the resource, however, is quite
disastrous.  I conclude that one can have a colored Control Panel
window with the General cdev, because I am looking at one right now.
Perhaps the General cdev manipulates the dialog color table directly,
and thus needs the 'dctb' to be present(?).

     Thanks for the tip.


"People forget how fast you did a job, but they remember how well you
did it."  Salada Tag Lines