AW: AW: NSColorWell shows no color
AW: AW: NSColorWell shows no color
- Subject: AW: AW: NSColorWell shows no color
- From: tobias assmann <email@hidden>
- Date: Wed, 31 Dec 2008 10:19:55 +0000 (GMT)
Hello,
I had a look in my nib file again and checked the following things:
no bindings are enabled
awake from nib is being called (can`t use debugger cause it is no app, but a gui of a audio unit, but printf told me)
I have exactly four instances of color well in my view
And here is the cause of my problem:
The view is overlapping my whole gui and its visibility should be toggled by a button of its superview:
// 'Show / Hide Preferences' Button has been pressed
- (IBAction)iaShowPreferences:(id)sender{
if([splitView isHidden])
[splitView setHidden:NO];
else
[splitView setHidden:YES];
if([prefView isHidden])
[prefView setHidden:NO];
else
[prefView setHidden:YES];
}
In IB the hidden checkbox of the preference gui was checked. It always seemed to work, exept the wells of course ;-)
If I uncheck 'hidden' the wells draw like they should, but I can`t see me other gui anymore. Everything works fine if I fire up the gui with my splitview having a [self setHidden:YES]; in awakeFromNib, exept I would like to see the splitView on startup :-(
The wells seem to get the white color, by setting there view to hidden in IB or awakeFromNib. But it`s is no problem to hide the view after it has been drawed once?! Seems a strange behaviour to me....
But many thanks for your answers up to here....and a nubby yoo yea ;-) of course
Tobias
________________________________
Von: Andy Lee <email@hidden>
An: tobias assmann <email@hidden>
CC: email@hidden
Gesendet: Mittwoch, den 31. Dezember 2008, 05:04:26 Uhr
Betreff: Re: AW: NSColorWell shows no color
On Dec 30, 2008, at 2:22 PM, tobias assmann wrote:
> I have built the stuff in IB. And looking into the nib file again, I have seen the should really show blue. But they are white, no matter if I set a color or not..
I wonder if this could be caused by inadvertently setting a binding? *Something* is changing the color well's color from the default provided by IB. If you select the color well in IB and select the Bindings inspector, is the "Bind to" check box unchecked?
> Unfortunately there is no more code related with the wells except having actions handling if a color gets choosen:
>
> // InActiveBeatColor has been selected
> - (IBAction)iaSelectInactiveBeatColor:(id)sender{
> [topv.colors setColor:[sender color] forKey:@"inactiveBeat"];
> }
>
> I am working on a cocoa gui of a audio unit. Because of this I don`t know how to do further debugging. It is my first experience in cocoa and osx programming :-(
My general approach when stumped is to question my simplest assumptions.
How sure are you that your awakeFromNib is being called? If you add a breakpoint at the beginning of awakeFromNib and run the debugger, do you break there? If not, maybe you misspelled or miscapitalized awakeFromNib? And while you're in the debugger, can you confirm that your four NSColorWell outlets are non-nil and all different?
Every once in a while someone realizes they accidentally made two instances of a subview, one exactly overlapping the other. In IB, if you go into list view, can you confirm that you have exactly four instances of NSColorWell in your window?
As an experiment, what if you create an entirely new color well and another outlet, and add a line to awakeFromNib that sets *that* color well's color? That should absolutely, positively work since nothing about the rest of your code could possibly be screwing it up.
--Andy
> Is there a way to have a closer look at the code produced by IB?? Maybe something is happening there..
>
> TIA!!!
>
> Tobias
>
>
>
>
> ________________________________
> Von: Graham Cox <email@hidden>
> An: tobias assmann <email@hidden>
> CC: email@hidden
> Gesendet: Dienstag, den 30. Dezember 2008, 12:22:11 Uhr
> Betreff: Re: NSColorWell shows no color
>
>
> On 30 Dec 2008, at 10:09 pm, tobias assmann wrote:
>
>> I changed the place of the initialization now. Still no difference.. The colors are valid. I checked this and also tried with predefined colors like [NSColor greenColor]. It seems a very strange problem to me. So am I right if I think, the colors should be drawn after they are set? Would make sense I my opinion.
>
>
> Yes, they should immediately show the set colour with no further work on your part.
>
> Clearly something else is wrong. Did you set up the interface in code or in IB? Usually when colour wells are created in IB they default to blue. If yours are white then it looks as if something is setting them, and white is suspicious because it's all 1's.
>
> You need to post more code or go through it closely in the debugger.
>
> --Graham
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden