Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Darkroom

Guest
Original poster
Dec 15, 2006
2,445
0
Montréal, Canada
hi there... if anyone feels like helping a total n00b please feel free... my source files are here: http://www.imagectrl.com/LightTest.zip

it's very small test app... i'm basically trying to enable the "Revert To White" item in the "Color" menu, but of course it isn't working... the "Revert To White" should immediately change the custom view to white...

any help would of course be appreciated...
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
You've got the menu setup correctly to call your selectWhite: action. However, selectWhite: in turn is not doing anything.

In windowColor you need to declare changeWhite: public, so that your WhiteController method can see it. Also it needs the
Code:
[self setNeedsDisplay:YES];
call just like changeColor: or else the view won't redraw. Lastly, you need to call your changeWhite: method in selectWhite: by using
Code:
[myWhiteSelection changeWhite:nil];
 

Darkroom

Guest
Original poster
Dec 15, 2006
2,445
0
Montréal, Canada
great it works now... but i have a warning:

"warning: 'windowColor' may not respond to '-changeWhite:' (Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.)

i think it's because i didn't declare it public, as you said?... i don't even know what that means :p let alone know how to make something public
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Simply add it to windowColor.h like so:

Code:
#import <Cocoa/Cocoa.h>

@interface windowColor : NSView {
	NSColor	*fillColor;
}

[b]- (IBAction)changeWhite:(id)sender;[/b]

@end
 

Darkroom

Guest
Original poster
Dec 15, 2006
2,445
0
Montréal, Canada
sweet! thanks... it's so funny, my app idea would probably take you pros about 20 seconds to build... gotta love the cocoa learning curve...

should both the color controller and white controller be in the same controller object? like would that make the app run faster or something? or is it more appropriate to have them separate like i have them currently?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.