Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @import <AppKit/CPButton.j>
- @implementation MMSToolbarButton : CPButton
- {
- CPString identifier @accessors;
- CPString buttonType @accessors;
- }
- - (id)initWithFrame:(CPRect)frame
- {
- self = [super initWithFrame: frame];
- [self setState:CPOffState];
- return self;
- }
- - (void)mouseUp:(CPEvent)anEvent
- {
- [super mouseUp:anEvent];
- if ([self buttonType] == CPToggleButton)
- {
- [self swapImages];
- [self setNextState];
- }
- }
- - (void)swapImages
- {
- var nextAltImage = [self image];
- var nextImage = [self alternateImage];
- [self setImage:nextImage];
- [self setAlternateImage:nextAltImage];
- }
- @end
Add Comment
Please, Sign In to add comment