• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask, environment and ... X11
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask, environment and ... X11


  • Subject: Re: NSTask, environment and ... X11
  • From: Camillo Lugaresi <email@hidden>
  • Date: Wed, 1 Feb 2006 01:54:23 +0100

On 01/feb/06, at 01:24, Thierry Passeron wrote:

Hello there
I was wondering why this piece of code doesn't work by itself on my mac ?


NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/bash"];

NSDictionary * environment = [NSDictionary dictionaryWithObjectsAndKeys:@"localhost:0.0",@"DISPLAY",nil];
NSArray * arguments = [NSArray arrayWithObjects: @"-c", @"/usr/ X11R6/bin/xhost + && /sw/bin/nedit", nil];
[task setEnvironment: environment];
[task setArguments: arguments];
[task launch];


It usually throws some error like this:

Xlib: connection to "localhost:0.0" refused by server
Xlib: No protocol specified

/usr/X11R6/bin/xhost:  unable to open display "localhost:0.0"

Anyway, a simple xhost + as root can solve the problem.

BUT ... it's weird !

I mean, I should be able to do the xhost + as the user to allow connection on the local machine don't you think?
So, does anyone knows how to deal with this problem without having to authenticate ?

Maybe I don't understand what you are trying to do, but can't you simply use open-x11?


Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTask, environment and ... X11 (From: Thierry Passeron <email@hidden>)

  • Prev by Date: Re: Fake NSMenu-like view
  • Next by Date: Re: Still struggling with Universal Binaries
  • Previous by thread: NSTask, environment and ... X11
  • Next by thread: Re: NSTask, environment and ... X11
  • Index(es):
    • Date
    • Thread