To Jerry and Arjen:

On 2012-08-23 02:22-0700 Jerry wrote:

> Hi Arjen,
>
> This [the simple wish test above] works exactly as you describe except it 
> runs as a native Aqua application, not as an X application. See my more 
> extensive comments to Alan.

@Jerry:

Just out of curiosity does Arjen's test also work with plserver?  That works
fine here with me, e.g.,

software@raven> plserver
%  pack [button .b -command {puts Hello} -text Hi]

If that works for you, is plserver a native app (depending on aqua
rather than X)?  You seemed to imply that in previous e-mails, but
please confirm.  If it is not an X application, then I am virtually
positive that violates one of the PLplot Tk assumptions which is that
plserver sets up a full X window for PLplot to draw on. That would
explain why you cannot get plserver (or wish) to run any PLplot
plotting commands while non-PLplot commands seem to work fine. If
Arjen can get the tkwin shared object to work under wish (see below)
and I confirm that fix on Linux, that is one PLplot Tk alternative
that will probably work for you on Mac OS X as well.

@Arjen:

This seems like a very similar problem to what you encounter on
Windows when you try and get the Tk part of PLplot to work.
Furthermore, Vince Darley dealt with the issue of cross-platform
portable Tk long ago with the tkwin dll (shared object) whose code can
be found at drivers/tkwin.c and bindings/tk-x-platform.

Here is the relevant comment from tkwin.c

//
// We want to use the 'pure Tk' interface.  On Unix we can use
// some direct calls to X instead of Tk, if we want, although
// that code hasn't been tested for some time.  So this define
// is required on Windows/MacOS and perhaps optional on Unix.
//
#define USE_TK

#ifdef __WIN32__
#define XSynchronize( display, bool )    { display->request++; }
#define XSync( display, bool )           { display->request++; }
#define XFlush( display )
#endif

The above comment implies that tkwin should not have any fundamental
showstoppers on Windows, Mac OS X, (and Linux).  However, it has
been many years since anybody actually tested this code, and
it turns out some bit rot has set in.

As of revision 12226 I have removed some of that bit-rot but not all
of it.  If I follow the (newly updated) directions at the end of
examples/tk/README.tkdemos to run runAllDemos.tcl under wish for
either the build tree or installed examples tree I
get pretty far.  Here is the latest result (from the build tree
in this case).

# To get all build-tree dependencies in place when -DBUILD_TEST=ON (Ignore the 
fact that
the final command will not work on Windows.)

make test_tk_standard_examples

# To build dev tkwin

make tkwin

cd examples/tk
software@raven> wish
% lappend auto_path ../../bindings/tk-x-plat ../../bindings/tk
/usr/share/tcltk/tcl8.5 /usr/lib /usr/local/lib/tcltk
/usr/local/share/tcltk /usr/lib/tcltk /usr/share/tcltk
/usr/share/tcltk/tk8.5 /usr/share/tcltk/tk8.5/ttk
../../bindings/tk-x-plat ../../bindings/tk
% package require Plplotter
attempt to provide package Plplotter 5 failed: package Plplotter 5.9.9
provided instead
% source runAllDemos.tcl

*** PLPLOT WARNING ***
plgdevlst:  too many devices

I also got the same result for the alternative case (installed
examples tree).

So wish found and dynloaded Plplotter (which corresponds to the tkwin
shared object), but it appears from the last WARNING message (which
froze the GUI although the command-line still worked within wish) that
there is still some bit rot somewhere in the tkwin shared object code
(e.g., drivers/tkwin.c and bindings/tk-x-plat/*.c).

Arjen, if you want to look further at this, you will see that
bindings/tk-x-plat/pkgIndex.tcl.in has separate Unix
and Windows logic, and I am virtually positive the Windows
part of this will need some updating.  But you should
be able to figure out what to do from the Unix logic there
and should be able to get as far as I did above
on Windows in fairly short order.

After that, I think all that should be required is minor updates to
the tkwin shared object code. The reason I make the claim is this
method was designed from the start (by Vince who worked exclusively on
Windows) to work on Windows. Vince also made it work on my Linux
platform just from making changes dealing with the error messages that
I gave him for that platform at that time (something like ~7 years
ago!).  Although that good Linux result for the tkwin shared object
was demonstrated only at a rather long time ago, I don't think we have
changed PLplot fundamentals too much since then so I don't think the
bit rot in the tkwin shared object code would be too difficult to fix
if you are interested.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to