Re: VW under Aqua (OS X)




Ir have read that under the latest version of OS X you will no longer need a startup script, X11 will supposedly start up automatically whenever an application requires it.

Note that this is hearsay, I haven't tried it myself yet.


R
-



Steven Kelly wrote:
"Jeff M." <massung@xxxxxxxxx> wrote in message news:d90a3c8a-4bfe-41f3-9d77-adb630863488@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2. Is it possible to use the X11 implementation w/o using X11 for
everything else on the OS (I'm assuming not, but figured I'd ask)?

Only the VW windows run as X11 windows, and they have the same window decorations as native windows. You don't get a new X desktop, nor do other applications change from being native to being X windows.

You can also make a shell script so that VW is able to start X when it starts up, making it seamless from the end-user's point of view. Below are our in-house notes on how to do this for our MetaEdit+ app: I've tried to edit them to make them more generic. They are based on VW 7.4.1, and so choose either the x86 or PPC VM depending on the platform (I think later VW versions are moving towards a universal binary). Most of our info was from here:
http://smcginty.wordpress.com/2007/03/10/visualwork-ing-again/

Starting X11 and the VisualWorks application like MetaEdit+
simultaneously is a bit tricky. In order to make this easier we use
a small application created by Lukas Renggli & co. The original
dictributed version of this application can be found as
http://www.iam.unibe.ch/~scg/Research/Moose/download/vw/visual-mac-intel-741d.app.zip
Copy and unzip this package to a suitable working directory.

Rename "visual-mac-intel741d.app" as "MyApp.app" (the
renaming can be done from the Finder, but for the rest of the
operations here it is probably better to use proper terminal session
as Finder cannot operate inside .app package unless ".app" extension
is removed from the name). Change then to ./MyApp/Contents/
Resources. The original version of Lukas' app expects Intel Mac and
incorporates VM for that platform. Currently, we are still on PPC
so we need to change the relevant parts of the package. First,
remove the "visual.app" folder that contains the supplied VM. Then,
you need to have "visual.app" for PPC X11. From this VM package,
copy file "./visual.app/Contents/MacOS/vwmacxx11gui" to our distro
package "./MyApp/Contents/Resources/". The contents of
this directory should now look like this:

AppSettings.plist
appIcon.icns
en.lproj
getdisplay
script
vwmacxx11gui

The next thing to do is to replace the file "script" with a modified
version of our own (below). This file will do most of the the
'dirty work', and makes the app start up in the user's directory.
Now copy the previously prepared image to this directory
as 'resource.im' (it is referred to with this name within the script).


------------------
#!/bin/bash
#
# Author: Aaron Voisine <aaron@xxxxxxxxxxx>
# Inkscape Modifications: Michael Wybrow <mjwybrow@xxxxxxxxxxxxxxxxxxxxx>
# VisualWorks Modifications: Lukas Renggli <renggli@xxxxxxxxxxxx>
# MetaEdit+ Modifications: Risto Pohjonen <rise@xxxxxxxxxxxx>

export APPHOME=`dirname "$0"`
USERDIR=~/Documents/MyApp

ps -wx -ocommand | grep -e '[X]11' > /dev/null
if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
echo "rm -f ~/.xinitrc" > ~/.xinitrc
sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
fi

cp -f "$APPHOME/getdisplay" /tmp/
rm -f /tmp/display.$UID
open-x11 /tmp/getdisplay || \
open -a XDarwin /tmp/getdisplay || \
echo ":0" > /tmp/display.$UID

while [ "$?" == "0" -a ! -f /tmp/display.$UID ]; do
sleep 1
done
export "DISPLAY=`cat /tmp/display.$UID`"

ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11
BASE="`echo "$0" | sed -e 's/\/script//'`"
shift

xset fp rehash
export PATH="$PATH":"$APPHOME"

#Guess which VM to use
if [ "`uname -p`" == "i386" ] ; then
VMNAME="vwmacx86x11gui"
else
VMNAME="vwmacxx11gui"
fi

# start the vm
cd "$USERDIR"
"$APPHOME/$VMNAME" "$APPHOME/resource.im" -noherald >&/dev/null
exit 0


.



Relevant Pages

  • Re: How can a script detect that Windows is shutting down?
    ... To do it the right way, you have to detect and handle the WM_QUERYENDSESSION message that windows will broadcast to every app, ... but subclassing is verboten in "pure" script, ... to detect the shutdown dialog, and then send a click to the ... If the user does a shutdown before closing the GUI the batch file still gets control when Windows closes the GUI app and attempts to send the file but doesn't have enough time to complete the transmit before Windows kills the batch file which results in incomplete files being sent. ...
    (microsoft.public.scripting.vbscript)
  • Re: VW under Aqua (OS X)
    ... Only the VW windows run as X11 windows, and they have the same window ... Below are our in-house notes on how to do this for our MetaEdit+ app: ... Starting X11 and the VisualWorks application like MetaEdit+ ... Copy and unzip this package to a suitable working directory. ...
    (comp.lang.smalltalk)
  • Re: X11 Problem
    ... I launch, say, Gimp, and X11 launches as does the app. ... But I never see the menus or windows for the actual application even though ...
    (comp.sys.mac.system)
  • Re: X11 Problem
    ... I launch, say, Gimp, and X11 launches as does the app. ... But I never see the menus or windows for the actual application even ...
    (comp.sys.mac.system)
  • Re: Parallels, M$ Virtual PC & VMWare - Re: For pmj
    ... but I will blame it on the lack of logic in Windows. ... When the script starts I got a pop up saying do you want to run this ActiveX control, I click Yes and off it goes. ... seconds, CPU time 30%-50%. ... I'll have a play with the C# app, I've probably misinterpreted something, it would make a good basis for a multi threaded test app. ...
    (uk.people.silversurfers)