Created
June 8, 2011 13:35
-
-
Save Synvox/1014426 to your computer and use it in GitHub Desktop.
This file contains 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
@import <Foundation/CPObject.j> | |
@import "UploadButton.j" | |
@import "FileLabel.j" | |
@implementation Uploader : CPObject | |
{ | |
var cib; | |
@outlet CPWindow uploaderWindow; | |
@outlet UploadButton uploadButton; | |
@outlet CPButton upload; | |
@outlet CPCollectionView fileList; | |
} | |
- (id)init | |
{ | |
if (self = [super init]) | |
{ | |
cib = [[CPViewController alloc] initWithCibName:"Uploader" bundle:nil owner:self]; | |
} | |
return self; | |
} | |
- (void)awakeFromCib | |
{ | |
[uploaderWindow center]; | |
[uploadButton setup:self]; | |
[uploadButton allowsMultipleFiles:YES]; | |
} | |
- (void) start | |
{ | |
[cib loadView]; | |
} | |
- (void) update | |
{ | |
var itemPrototype = [[CPCollectionViewItem alloc] init]; | |
var z = [[FileLabel alloc] init]; | |
[itemPrototype setView:z]; | |
[fileList setItemPrototype:itemPrototype]; | |
var given = [uploadButton selection]; | |
for(var i = 0; i < [given count]; i++) | |
alert(given[i]); | |
[fileList setContent:given]; | |
} | |
- (@action) uploadFiles:(id)sender | |
{ | |
alert([uploadButton selection]); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment