Last active
December 31, 2015 16:38
-
-
Save kballenegger/8014488 to your computer and use it in GitHub Desktop.
Custom window problem
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
| { | |
| NSView *emailFieldContainer = [[NSView alloc] initWithFrame:NSMakeRect(80.0/2, 150.0/2, 650.0/2, 60.0/2)]; | |
| self->emailField = [[NSTextField alloc] initWithFrame:NSMakeRect(10.0/2, 10.0/2, 670.0/2, 40.0/2)]; | |
| self->emailField.stringValue = @"[email protected]"; | |
| [self->emailField setFont:boldFont]; | |
| [self->emailField setEditable:YES]; | |
| self->emailField.drawsBackground = NO; | |
| [self->emailField setBezeled:NO]; | |
| self->emailField.textColor = [NSColor colorWithCalibratedRed:0.872 green:0.197 blue:0.228 alpha:1.000]; | |
| [self->emailField setWantsLayer:YES]; | |
| [emailFieldContainer addSubview:self->emailField]; | |
| [emailFieldContainer setWantsLayer:YES]; | |
| emailFieldContainer.layer.cornerRadius = kMacchiatoEmailSubscriptionWindowButtonRadius; | |
| emailFieldContainer.layer.borderWidth = 1.0; | |
| emailFieldContainer.layer.borderColor = blueColor.CGColor; | |
| } | |
| - (void)show { | |
| [NSApp runModalForWindow:self.window]; | |
| [self.window makeKeyAndOrderFront:nil]; | |
| [self.window makeFirstResponder:self->emailField]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment