|
From: <tim...@en...> - 2005-06-24 19:41:18
|
Ethan Merritt wrote: >On Friday 24 June 2005 01:42 pm, Timoth=C3=A9e Lecomte wrote: > =20 > >>Ethan Merritt wrote: >> =20 >> >> The remaining problem is that setjmp/longjmp were=20 >>designed for C, not C++. >> =20 >> >I see. So your new driver is C++ only?=20 > It is C++ only, but until now I have managed to mix C and C++ without=20 problems. I have added a few lines in configure.in (for both c++ and=20 wxwidgets), written my terminal as a common wxt.trm whith C++ functions=20 defined in an external wxt.cpp file. >That is already a potential problem since the rest of the gnuplot is dis= tinctly not C++ code. >I fear it will limit the number of platforms on which your new >driver will actually compile and link into gnuplot successfully. >We'll find out, I guess. > =20 > According to c++ documentation, it should not be a problem (provided we=20 have a c++ compiler for the desired platform ;-). The C and C++ files=20 are compiled by their respective compilers, and then the C++ one link=20 everything. It works at least on my machine. >>So if I initialize the =20 >>longjump when creating my terminal thread, it doesn't delete the old=20 >>window but open a new one when longjmp is used ! However, it does not=20 >>segfault... So the solution may be to check if another window is opened= =20 >>and destroy it before to continue. That doesn't seem very efficient. >> =20 >> > >Can't you do the same thing as the x11 driver? When you send a new >plot command the driver looks to see if there is an existing window and = if >so uses it. If there is no existing window then it opens a new one. >See the difference? You check for an old window, but instead of destoyi= ng >it you just use it explicitly for the new plot also. > =20 > I think that all this setjmp/longjmp stuff makes it difficult. I've=20 tried some combinations, and even if objects are not destroyed, they are=20 not usable ! I can't tell anything to the frame. On the other hand, I wrote things so that when user closes the terminal=20 window, in fact he only hides it, so on next plot it is still available=20 and it is asked to unhide. But setjmp/longjmp are not the same problem=20 unfortunately ! Timoth=C3=A9e Timoth=C3=A9e |