CLI works - GUI does not

Hello,
I have complied several Desktop programs and used them on the Rasp-2. None of these applications used the GPIO. The apps established TCP Listening capability on specific ports and worked well. Then I moved onto a data parsing exercise where I would end up needing to either set an output or in a another example read an input and send that data out.

Each time I enable GPIO.SetupGPIO the Desktop app fails to run

I can get apps such as Blinker to work including to modify the blink rate and duty cycle using CLI. However the Desktop Blinker app in the samples directory fails to run just like the ones I am developing. I can get the app to work by commenting out

[code] 'GPIO.SetupGPIO

// Set the pin to accept output
'GPIO.PinMode(kLEDPin, GPIO.OUTPUT)

// Set the button pin to accept input
'GPIO.PinMode(kButtonPin, GPIO.INPUT)[/code] however as you can guess that is not much good for anything since I cannot read-write to-from the GPIO when using Desktop apps.

Not sure what is not be correct.

I have gone through the steps of deleting the wiringPi folder then re-downloading from git clone and performing ./build without success.

I do not think that is the problem since this gpio -v and this gpio readall provide the correct responses in the CLI

I am using XOJO 2015r4 on MAC

Pi 2 is
cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5

cat /proc/version
Linux version 4.1.13-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015

Are you running the desktop app with gksudo?

Refer to Using GPIO on this page:

http://developer.xojo.com/raspberry-pi

Also see the syntax here:
http://developer.xojo.com/desktop-gpio-app

Should have mentioned that I receive this error

Running this as ssh on the MAC

You cannot run a GUI application in a Shell window remotely…that is what the error you are seeing means.

You are attempting to hook into the GUI process, which has no STD IN/OUT which the Shell can utilize. You do not need any GPIO.Setup in your desktop application. A CLI is purely STD IN/OUT and the Shell terminal may utilize such.

If you must start the GUI app from a terminal remotely, look into “nohup”

Try using VNC to remotely connect to the desktop instead.

On VNC using CLI gksuxd ./BlinkerDesktop the following error message is displayed

[quote]Client is not authorized to connect to Server
( gksudo: 9560): Gtk-WARNING **: cannot open display 1:0[/quote]

This appears to be a permissions problem. I ran chmod [quote] sudo chmod -R a=rwx *[/quote] on tightvncserver and wiringPi folders. I validated permission using [quote]ls -lr
[/quote] settings to UOG and they are set to include read - write - execute

Running CLI for a console app either in Terminal of SSH or VNC works