Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created September 5, 2010 20:18
Show Gist options
  • Save benlangfeld/566288 to your computer and use it in GitHub Desktop.
Save benlangfeld/566288 to your computer and use it in GitHub Desktop.
@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