I've tested the code with 0.7.1, 0.8.1 and the latest nightly build
all with the same results - the Upload File button doesn't click down
when the button is clicked. Other than that everything works fine.
File uploads work, status and error reports work fine.
Perhaps I'm not using the FileUpload object properly? I've included
the test AppController.j below. FileUpload.j is the unaltered code
from gist except for adding ampersands to the three import statements
at the head of the file (i.e. @import instead of import). So what am
I doing wrong?
Mike
<AppController.j> ...
@import <Foundation/CPObject.j>
@import "FileUpload.j"
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc]
initWithContentRect:CGRectMakeZero()
styleMask:CPBorderlessBridgeWindowMask];
var contentView = [theWindow contentView];
var fileUploadButton = [[UploadButton alloc]
initWithFrame:CGRectMake(10, 10, 100, 24)];
[fileUploadButton setTitle:"Upload File"];
[fileUploadButton setBordered:YES];
[fileUploadButton setURL:"
http://localhost:2345/file_upload/"];
[fileUploadButton setDelegate:self];
[contentView addSubview:fileUploadButton];
[theWindow orderFront:self];
}
-(void) uploadButton:(UploadButton)button didChangeSelection:
(CPString)selection
{
console.log("Selection has been made: " + selection);
[button submit];
}
-(void) uploadButton:(UploadButton)button didFailWithError:
(CPString)anError
{
console.log("Upload failed with this error: " + anError);
}
-(void) uploadButton:(UploadButton)button didFinishUploadWithData:
(CPString)response
{
console.log("Upload finished with this response: " + response);
[button resetSelection];
}
-(void) uploadButtonDidBeginUpload:(UploadButton)button
{
console.log("Upload has begun with selection: " + [button
selection]);
}
@end
On May 6, 6:22 pm, Chandler Kent <
ckents...@gmail.com> wrote:
> We use that code for our project. We recently discovered it was broken
> in the latest master due to this commit:
>
>
http://github.com/280north/cappuccino/commit/0e4d476d76dea59ce44d2848...
>
> However, this commit is reverted in 0.8.1, so those frameworks work
> fine.