Created
January 22, 2015 19:38
-
-
Save charlieMonroe/8e0b1416c5a68a0b4106 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void)_generateButton:(NSWindowButton)buttonKind mouseOver:(BOOL)over name:(NSString*)name{ | |
| NSImage *image = [[[NSImage alloc] initWithSize:NSMakeSize(12.0, 12.0)] autorelease]; | |
| NSButton *button = [_window standardWindowButton:buttonKind]; | |
| if (over){ | |
| [[button cell] mouseEntered:nil]; | |
| } | |
| [image lockFocus]; | |
| [[button cell] drawWithFrame:NSMakeRect(0.0, 0.0, 12.0, 12.0) inView:button]; | |
| [image unlockFocus]; | |
| [[image PNGRepresentation] writeToFile:[[NSString stringWithFormat:@"~/Desktop/%@%@.png", name, over ? @"_over" : @""] stringByExpandingTildeInPath] atomically:YES]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment