drawer back ground colour

Hi

I have a AS studio application that has a drawer with text and buttons, I want to make the background colour of the drawer black, I have tried putting a text field behind text and buttons making it’s back ground colour black, then compiling, the black back ground shows but the text and buttons do not (text is green, buttons their usual colour).

Is their a way to achieve what I am after?, if so how?

Cheers
Budgie

So what are you saying… that the text field with the black background is in front of the other stuff such that they can’t be seen? If so just put it to the back. Or are you saying that because it’s black you can’t see the other stuff well. If so then don’t use black. The only other way I can think to make the background black is to use an image view and put a black image in it.

“that the text field with the black background is in front of the other stuff”

No, it is definitely in the back ground.

“Or are you saying that because it’s black you can’t see the other stuff well”

No, buttons are usual colour, text is green.

Text field is behind everything, compile project, I can see black text field but no buttons etc, which were in IB in front?

Ill try your image view suggestion

Cheers
Budgie

OK, I understand… you’re problem is that the text field is in the back in IB but it’s in the front when you launch your application.

In that case my suggestion would be to send the text field to the back programatically when your application starts. That type of problem was just posted recently and I gave some advice, see this: http://bbs.macscripter.net/viewtopic.php?id=25778

wow, did that unlock some doors, cheers

what I ran into while looking into what you have suggested is the below (I got a bit side tracked) :smiley:

This works great for window “main”: (both the below are in a “on awake from nib”)

set alpha value of window "main" to 0.6
	
	set background color of window "main" to {1, 1, 1}
	tell window "main" to update

but this does not work for the drawer:

set background color of drawer "drawer" to {1, 1, 1}
	tell drawer "drawer" to update

it throws this error:
Cant make class bacC of class draA “drawer” into type reference (-1700)

any ideas o how to implement background colour for drawer?

cheers
Budgie

A drawer is associated with a window, so you have to tell drawer “drawer” of window “mainWindow”. But I’m glad you got it to work.

We should all send money to Mark Alldritt for Script Debugger!
It makes figuring these things out relatively easy.

I opened up the Drawer example and this is what changed the background color of the drawer.


tell application "Drawer"
	set background color of window of content view of drawer 1 of window 1 to {1, 1, 1}
end tell

hth,

Craig

yeah I got it to work on window main, but not on the drawer.

I have tried:

tell drawer "drawer" of window "main"
					set background color of drawer "drawer"to {1, 1, 1}
					tell drawer "drawer" to update
				end tell

and

	tell drawer "drawer" of window "main"
					set background to {1, 1, 1}
					tell drawer "drawer" to update
				end tell

it keeps throwing the error as mentioned before

Budgie

fantastic stuff Craig works like a charm , cheers :smiley:

thanks regulus6633 for unlocking a heap of new information :smiley:

Budgie