Skip to content

Commit

Permalink
Change the name of the app to Erlang
Browse files Browse the repository at this point in the history
  • Loading branch information
dgud committed Mar 2, 2011
1 parent 4f28fe5 commit 0f451f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions c_src/esdl_driver.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,19 +112,22 @@ static ErlDrvData sdl_driver_start(ErlDrvPort port, char *buff)
return (ErlDrvData) data; return (ErlDrvData) data;
} }


#ifdef _OSX_COCOA
extern OSErr CPSSetProcessName (ProcessSerialNumber *psn, char *processname);
#endif


void esdl_init_native_gui() void esdl_init_native_gui()
{ {
#ifdef _OSX_COCOA #ifdef _OSX_COCOA
ProcessSerialNumber psn; ProcessSerialNumber psn;
NSAutoreleasePool *pool; NSAutoreleasePool *pool;


[[NSProcessInfo processInfo] setProcessName:@"Erlang"]; // [[NSProcessInfo processInfo] setProcessName:@"Erlang"];
// Enable GUI // Enable GUI
GetCurrentProcess(&psn); GetCurrentProcess(&psn);
CPSSetProcessName(&psn, "Erlang"); // Undocumented function (but above doesn't work)
TransformProcessType(&psn, kProcessTransformToForegroundApplication); TransformProcessType(&psn, kProcessTransformToForegroundApplication);
SetFrontProcess(&psn); SetFrontProcess(&psn);



// Enable Cocoa calls from Carbon app // Enable Cocoa calls from Carbon app
NSApplicationLoad(); NSApplicationLoad();
Expand All @@ -135,7 +138,7 @@ void esdl_init_native_gui()
NSApplication *app = [NSApplication sharedApplication]; NSApplication *app = [NSApplication sharedApplication];
// Load and set icon // Load and set icon


NSMutableString *file = [[NSMutableString alloc] init]; //NSMutableString *file = [[NSMutableString alloc] init];
//[file appendFormat:@"%s/%s", erl_wx_privdir, "erlang-logo64.png"]; //[file appendFormat:@"%s/%s", erl_wx_privdir, "erlang-logo64.png"];
//[file appendFormat:@"%s/%s", "/usr/local/lib/erlang/lib/wx-0.98.8/priv", "erlang-logo64.png"]; //[file appendFormat:@"%s/%s", "/usr/local/lib/erlang/lib/wx-0.98.8/priv", "erlang-logo64.png"];
//NSImage *icon = [[NSImage alloc] initWithContentsOfFile: file]; //NSImage *icon = [[NSImage alloc] initWithContentsOfFile: file];
Expand Down

0 comments on commit 0f451f5

Please sign in to comment.