MacGapProject / MacGap1

Desktop WebKit wrapper for HTML/CSS/JS applications.
Other
3.55k stars 209 forks source link

Modal sheets anyone ? #120

Closed perfaram closed 10 years ago

perfaram commented 10 years ago

I made a small piece of code to display Modal Sheets. Unfortunately, can't figure myself out how to link it to JS interface (and be able to use it from there).

Here's the code (goes into Notice.m)

- (void) modalSheet:(NSDictionary *)message {
    NSAlert *alert = [[NSAlert alloc] init];
    [alert setMessageText:[message valueForKey:@"title"]];
    [alert setInformativeText:[message valueForKey:@"content"]];
    [alert beginSheetModalForWindow:[[NSApplication sharedApplication] mainWindow]
                      modalDelegate:self
                     didEndSelector:nil
                        contextInfo:nil];
    [alert runModal];
    //[alert release];
    //@selector(alertDidEnd:returnCode:contextInfo:)
}

And in Notice.h

- (void) modalSheet:(NSDictionary*)message;

This was my tiny daily contribution :-)

rawcreative commented 10 years ago

This can be closed I've added this functionality to MacGap 2..

perfaram commented 10 years ago

Great !