|
From: Ethan M. <merritt@u.washington.edu> - 2009-02-06 17:02:34
|
On Friday 06 February 2009 00:45:40 Petr Mikulik wrote: > > 3. New global variable current_x11_windowid should be placed in an .h + .c > > file. Which one? > > > That will probably not work. There can be multiple x11 windows open at > > the same time, so there is no "current" one. Since you can associate a > > window number with each one, however, we might be able to do: > > set term x11 5 > > print TERM_X11_WINDOW_5_ID > > The current one is the current active one. It is the last one from "set term > x11". The value of GPVAL_TERM_WINDOWID is to be used by a front-end (such as > Octave) using gnuplot for drawings; thus, it can fetch the Window ID just > after the plot command. But "set term x11 5" will not necessarily open a new window; it will re-use the old window #5 if there is one. So it will not necessarily trigger a window creation event, and thus would not automatically update your proposed *_CURRENT_* variable. I suppose the terminal driver could maintain a list of previously-created window ids. -- Ethan A Merritt |