How to autostart X11 from GTK application on Mac OS X




	Hi,

First of all, apologies if this has already been covered on this list but the archive search is down. I have a GTK application that works under Mac OS X. My goal is to be able to run this program from a Mac 'bundle'. I have been able to gather runtime files for GTK and I can start the program from a shell script that sets the DYLD_LIBRARY_PATH. I have now been able to use the 'install_name_path' to alter the dynamic library links for my program to point to relative links in a bundle (Contents/Frameworks). If I run the program via SSH (and X11 forwarding is on) I am able to run my program without needing the shell script. Great. That is until I try running the bundle from within Mac OS X itself. The problem comes when the program starts it doesn't have any 'DISPLAY' environment variable and gtk_init_check returns false. Now, my program is built to be run either with GUI or without, so it goes and sits in non-gui mode. :/ .. So, I can run my program from a bundle within Mac OS X, I just can't get it connected to X. I tried running X11 before starting my program. No change. I tried not having the X libraries within my application's bundle. No change, still don't get a display. If I set the display variable within a Mac OSX 'Terminal' and X11 is running, my program starts up great. So, question is, how do I get Mac OS X to a) start X11 for me, and b) provide my program the equivalent of the 'DISPLAY' variable so gtk_init_check will be happy there's an X display there and all will come to life? I'd appreciate any help about it. This may not even be the correct list to ask such things on (since it's a big Mac related) but since I'm using GTK for my cross-platform GUI, I thought I'd ask).

	Thanks,

	Derek

--
Derek Piper - dcpiper indiana edu - (812) 856 0111
IRI 323, School of Informatics
Indiana University, Bloomington, Indiana



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]