Women in Technology

Hear us Roar



Article:
  Creating a Color Meter Using Cocoa
Subject:   awakeFromNib
Date:   2001-09-16 13:49:15
From:   sork
The initial values are attributes stored in the slider controls so we can send these to the set methods already defined:


- (void)awakeFromNib
{
[self setRed:redSlider];
.
.
.
}


Bertil Holmberg

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • awakeFromNib
    2001-10-02 20:09:05  rick1138 [View]

    Use this code (below) that initializes the variables,displays them in the text fields,and then sets the color well accordingly.This is a useful little app for OpenGL programmers-sice RGB values are calculated from 0 to 1 like OpenGL,you can experiment with color values without having to continually type them in and recompile a full application.



    - (void)awakeFromNib
    {
    redValue = 1.0;
    blueValue = 1.0;
    greenValue = 1.0;
    alphaValue = 1.0;

    [redField setFloatValue:redValue];
    [greenField setFloatValue:greenValue];
    [blueField setFloatValue:blueValue];
    [alphaField setFloatValue:alphaValue];

    [self updateColor];


    }