Graphics Reference
In-Depth Information
LISTING 6-14
Continued
CFRelease
(green);
}
-(
IBAction
)doTransition:(
id
)sender;
{
CGRect
contentRect =
NSRectToCGRect([[window
contentView
]
frame
]);
if
(toggle)
{
[transitionLayer
setBounds
:contentRect];
}
else
{
CGRect
newFrame =
CGRectMake
((contentRect.
size
.
width
/ 2) - 100.0,
(contentRect.
size
.
height
/ 2) - 100.0,
contentRect.
size
.
width
- 200.0,
contentRect.
size
.
height
- 200.0);
[transitionLayer
setBounds
:newFrame];
}
toggle = !toggle;
}
- (
void
)dealloc;
{
[transitionLayer
release
], transitionLayer =
nil
;
[
super
dealloc
];
}
@end
Similarly, you can implement the ripple filter transition when using delegation using the
code in Listing 6-15.
LISTING 6-15
AppDelegate Implementation Using Delegation
@interface
AppDelegate : NSObject {
IBOutlet
NSWindow *window;