Re: Launching X11 client with NSTask
Re: Launching X11 client with NSTask
- Subject: Re: Launching X11 client with NSTask
- From: Chris Ridd <email@hidden>
- Date: Thu, 27 May 2004 21:32:54 +0100
On 27/5/04 7:42 pm, Drew McCormack <email@hidden> wrote:
>
I am testing launching of X11 programs from inside Cocoa, but I can't
>
get it to work. I get this error:
>
>
Xlib: connection to "localhost:0.0" refused by server
>
Xlib: No protocol specified
>
>
Error: Can't open display: localhost:0.0
>
>
>
This is the code:
>
>
NSTask *task = [[[NSTask alloc] init] autorelease];
>
[task setLaunchPath:@"/usr/X11R6/bin/xeyes"];
>
[task setEnvironment:
>
[NSDictionary dictionaryWithObjectsAndKeys:
>
@"localhost:0.0", @"DISPLAY",
>
nil]];
>
[task launch];
>
>
Can anyone with more understanding of X11 than me tell me what I am
>
missing? (Note the xeyes works fine from the command line in either an
>
xterm or an apple terminal.)
>
>
Drew
Check what Apple's open-x11 shell script does...
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.