From: Petr M. <mi...@ph...> - 2004-06-18 13:09:41
|
> I have some ideas, but not a complete solution. > How exactly do you "close gnuplot"? Do you mean that you > click on one of the buttons that the window manager adds to > the frame of the plot window? Or do you type "q", or what? Yes, by hitting "q" key or by Alt-F4. > On the gnuplot side I have added code to terminate the > paused_for_mouse state whenever a GE_reset event is seen. > > Please let me know if this change resolves your problems with > running gnuplot via a script. There are ways to close a window that > bypass this mechanism (killing gnuplot_x11 from the command line is > one of them), but I think this change handles the normal cases. Yes, it works better. Now, can you please add the following improvement: If user closes gnuplot_x11, then "show variables" should have define all usual mousing variables, obviously with zero values, and the MOUSE_KEY should be set to -1: MOUSE_X = 0 MOUSE_Y = 0 MOUSE_X2 = 0 MOUSE_Y2 = 0 MOUSE_SHIFT = 0 MOUSE_ALT = 0 MOUSE_CTRL = 0 MOUSE_KEY = -1 This is absolutely important in order not to break scripts for bidirectional communication of other programs with gnuplo, which get feedback from mousing by writing the above MOUSE_* values to pipe / fifo. In my testing Octave scripts, which does some actions passed from gnuplot's "pause mouse key", after the following sent to gnuplot via fifo: fprintf(gp.f, 'pause mouse key\n\n'); fflush(gp.f); fprintf(gp.f, 'print MOUSE_X, MOUSE_Y, MOUSE_KEY\n'); fflush(gp.f); gnuplot reports (obvious) error: "undefined variable: MOUSE_KEY". Finally, what do you think about this: "q" hotkey is disabled when "pause mouse key" comes to action; thus, command.c should call "x11_hotkeys(0)" and afterwards "x11_hotkeys(1)" to enable them again. Note that "<space>" hotkey is still quite useful to be unchanged. --- PM |