Created
September 5, 2010 20:18
-
-
Save benlangfeld/566288 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
@implementation TransferDialog : CPObject | |
{ | |
CPPanel _transferPanel; | |
CPTextField _URIText; | |
CPTextField _URILabel; | |
} | |
- (id)init | |
{ | |
if(self = [super init]) | |
{ | |
// Setup the panel | |
_transferPanel = [[CPPanel alloc] initWithContentRect:CGRectMake(0.0,0.0,400.0,110.0) styleMask:CPTitledWindowMask]; | |
[_transferPanel setTitle:@"Enter transfer URI"]; | |
var bounds = [[_transferPanel contentView] bounds]; | |
// Setup the label | |
_URILabel = [[CPTextField alloc] initWithFrame:CGRectMake(10.0,10.0,0,0)]; | |
[_URILabel setObjectValue:@"URI: "]; | |
[_URILabel sizeToFit]; | |
// Setup the TextField | |
var labelBounds = [_URILabel bounds]; | |
_URIText = [[CPTextField alloc] initWithFrame:CGRectMake(40.0,10.0,10.0,10.0)]; | |
[_URIText setEditable:YES]; | |
// Add the widgets. | |
[[_transferPanel contentView] addSubview:_URILabel]; | |
[[_transferPanel contentView] addSubview:_URIText]; | |
} | |
return self; | |
} | |
- (void)runModal | |
{ | |
[CPApp runModalForWindow:_transferPanel]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment