MacGapProject / MacGap1

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

Native menu and log support #80

Closed pammacdotnet closed 10 years ago

pammacdotnet commented 10 years ago

I've added native menus and system logging support from within apps. Everything is explained in my README.md.

I hope you'll find it useful. Thanks for your work. Greetings from Spain. Alberto.

jeff-h commented 10 years ago

Thanks for your work on this. I am wondering whether you would consider extending this so that we could:

jeff-h commented 10 years ago

I have just committed code which adds menu support. Some of the code was taken from your commit here, so thanks for your work.

Can you explain the need for a log-NSLog bridge? I just use the webview's developer tools to see the console output.

jeff-h commented 10 years ago

Since MacGap already contains the following I'm not seeing the purpose of the NSlog bridge in your code, sorry! Please do re-open this if I've missed something that the following doesn't provide.

- (void) webView:(WebView*)webView addMessageToConsole:(NSDictionary*)message
{
    if (![message isKindOfClass:[NSDictionary class]]) { 
        return;
    }

    NSLog(@"JavaScript console: %@:%@: %@", 
          [[message objectForKey:@"sourceURL"] lastPathComponent],  // could be nil
          [message objectForKey:@"lineNumber"],
          [message objectForKey:@"message"]);
}