1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

can't get it to work!

Discussion in 'Mac Programming' started by Darkroom, Oct 31, 2007.

  1. Guest


    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...
  2. Moderator emeritus


    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
    [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
    [myWhiteSelection changeWhite:nil];
  3. Guest


    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
  4. Moderator emeritus


    Simply add it to windowColor.h like so:

    #import <Cocoa/Cocoa.h>
    @interface windowColor : NSView {
    	NSColor	*fillColor;
    [b]- (IBAction)changeWhite:(id)sender;[/b]
  5. Guest


    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?

Share This Page