I finally isolated the problem in combining GF/Pd/X11/OSX, and it is not GF's fault. It boils down to this: pd/src/makefile links Pd to Tcl/Tk (using -framework Tcl -framework Tk in LDFLAGS) but this is wrong, because it does so on the Pd server, which doesn't run any Tcl code!
It would be so nice if this were fixed in all three branches of Pd (miller,devel,impd). I've made the fix only in makefile though. it would be better if it were made in configure.in then propagated to relevant files.
---------- Forwarded message ---------- Date: Wed, 31 Mar 2004 15:34:24 -0500 (EST) From: Mathieu Bouchard matju@sympatico.ca To: James Tittle II tigital@mac.com Subject: Re: gridflow on 10.3, with pd
On Wed, 31 Mar 2004, Mathieu Bouchard wrote:
The problem with the X11 thing is that for some mysterious reason it does not allocate the Window while at the same time appearing to be doing so. Then when I try writing in the window, I get a X11 error and it goes boom.
Ok, an update on this, I used GDB to figure things out, and here's what it does look like:
For some weird reason, the server links with both Tcl and Tk. I would have expected at most Tcl, and actually, given my experience with Pd, I would have expected none, as I haven't seen any calls to Tcl in the server code.
Tk/OSX seems to define X11 functions, such that although GridFlow is dynamically linked by gcc/ld to work with libX11.so, it gets all its X11 functions from Tk, because apparently the Tk port to OSX involves a kind of X11 emulator implemented with Quartz, _and_ this emulator doesn't work well enough that GridFlow could display anything.
Which leads to:
#0 0x0b0e71c8 in TkMacOSXGetDrawablePort (drawable=4194305) at tkMacOSXSubwindows.c:964 #1 0x0b0e61d4 in XResizeWindow (display=0x32b620, window=4194305, width=16, height=16) at tkMacOSXSubwindows.c:284 #2 0x00988d88 in FormatX11::resize_window(int, int) (this=0x1b3370, sx=16, sy=16) at format/x11.c.fcs:374 #3 0x00b0c844 in void FormatX11::grid_inlet_0<long>(GridInlet*, int, Pt<long>) (this=0x1b3370, in=0xdde620, n=-1, data={p = 0x0, start = 0x0, n = 0}) at format/x11.c.fcs:413
So GridFlow wants to use X11, and it ends up in Tcl/Tk's hands, in the frigging server. Neat, eh?
Mathieu Bouchard http://artengine.ca/matju