// Code to create a "Glass" button and render it to a png on your desktop.// Run this from the SIMULATOR and change my username to yours.// Update: This uses a private iPhone SDK. Do not use this code in your shipping app. Use it merely to generate the PNG file for you to use in a fake button.Class theClass = NSClassFromString(@"UIGlassButton");
UIButton *theButton = [[[theClass alloc]initWithFrame:CGRectMake(10, 10, 120, 44)]autorelease];
[theButton setValue:[UIColor colorWithHue:0.267saturation:1.000brightness:0.667alpha:1.000]forKey:@"tintColor"];
//[theButton setTitle:@"Accept" forState:UIControlStateNormal];[self.view addSubview:theButton];
UIGraphicsBeginImageContext(theButton.frame.size);
CGContextRef theContext = UIGraphicsGetCurrentContext();
[theButton.layer renderInContext:theContext];
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
NSData *theData = UIImagePNGRepresentation(theImage);
[theData writeToFile:@"/Users/schwa/Desktop/test.png"atomically:NO];
UIGraphicsEndImageContext();