Fix error when plotting from IDL 8.5

Posted on Sun 13 November 2016 in How To

Originally from here

Issue when trying to plot from IDL 8.5 running XQuarts 2.7 the follow error occurs

Error: attempt to add non-widget child "dsm" to parent "idl" which supports only widgets

A workaround is to alter the idl and idlde scripts making sure the DYLD_LIBRARY_PATH environment variable includes the directory /opt/X11/lib/flat_namespace/

So at around line 245 in idl /Applications/exelis/idl85/bin/idl

if [ "$DYLD_LIBRARY_PATH" = "" ]; then
    DYLD_LIBRARY_PATH="/opt/X11/lib/flat_namespace:$BIN_DIR"
    #DYLD_LIBRARY_PATH="$BIN_DIR"
else
    DYLD_LIBRARY_PATH="/opt/X11/lib/flat_namespace:$BIN_DIR:$DYLD_LIBRARY_PATH"
    #DYLD_LIBRARY_PATH="$BIN_DIR:$DYLD_LIBRARY_PATH"
fi

and in idlde /Applications/exelis/idl85/bin/idlde

if [ "$APPLICATION" = "idlde" ]; then
    # add bindir for idlde shareable libraries
    #DYLD_LIBRARY_PATH="$BIN_DIR_IDLDE:$DYLD_LIBRARY_PATH"
    DYLD_LIBRARY_PATH="/opt/X11/lib/flat_namespace:$BIN_DIR_IDLDE:$DYLD_LIBRARY_PATH"
    IDL_START_DIR_DARWIN=`pwd`
    export IDL_START_DIR_DARWIN
fi

also see XQartz release notes