|
From: Ben A. <bpa...@ma...> - 2009-02-11 19:19:19
|
On Wednesday, February 11, 2009, at 10:08AM, "Petr Mikulik" <mi...@ph...> wrote: >On Fri, 6 Feb 2009, Ethan Merritt wrote: > >> On Friday 06 February 2009 13:57:41 Petr Mikulik wrote: >> > > The intent is to update GPVAL_TERM_WINDOWID when the main program receives a >> > > "new window" event from gnuplot_x11, right? >> > > >> > > I am trying to point out that not every command "set term x11 <num>" creates >> > > a new window. If an old window is re-used, you won't receive this event and >> > > therefore GPVAL_TERM_WINDOWID will not be updated. >> > > >> > > The patch currently has the event generated each time the buffered command >> > > list is re-executed, which I think is not right. Probably it should go in >> > > pr_window(), immediately after the call to XCreateWindow(). >> > >> > When I tested it, it was filling the variable after the "plot" command has >> > been completed (not after "set term x11"), i.e. after the graph has been >> > drawn. >> >> I think the correct patch on the gplt_x11.c end is something like the one >> attached here. > >I have updated the patch >[ 2570385 ] GPVAL_X11_WINDOWID >https://sourceforge.net/tracker/?func=detail&atid=302055&aid=2570385&group_id=2055 >with Ethan's solution and an additional wrapper over GE_plotdone sender. >Now, only changed window ID's are sent to gnuplot for the variable >GPVAL_TERM_WINDOWID to be updated. > >Ben, can you please test it? Would it suite the needs in Octave? Looks good to me. gnuplot> plot sin(x) AGAIN: gplt_x11.c:3727: SENDING NEW WINDOWID 0x200026 TO GNUPLOT... gnuplot> mouse.c:1848: set current_x11_windowid to 200026 gnuplot> show var GPVAL_TERM_WINDOWID Variables beginning with GPVAL_TERM_WINDOWID: GPVAL_TERM_WINDOWID = 2097190 Ben |