|
From: Ben A. <bpa...@ma...> - 2009-02-13 23:56:38
|
On Feb 13, 2009, at 6:12 PM, Petr Mikulik wrote: >>>> unless user explicitly changes these values via >>>> set(gcf, 'position', [new values]) >>>> I propose you add a static variable which remembers last >>>> 'position' values >>>> and does "set term ... size position" only in case of a change. I >>>> think this >>>> is a useful compromise. > > I propose the following solution to this case: > > gnuplot: > - I will commit the patch to define GPVAL_TERM_WINDOWID. ok > Octave: > - It will use "set term ..." without "size and position" by default. > - It will have a flag to see whether user has changed (gcf, > 'position') > explicitly; only in this case, it will use "set term .. size > position". > - If user wants get(gcf), then Octave will find the current values by: > 1a. launch new gnuplot instance with > set term x11 position 100,100 size 100,100 > 1b. by means of GPVAL_TERM_WINDOWID and xwininfo, get the > current value of position => these are the correction factors > with respect to the above 100,100 > 1c. close this dummy gnuplot session > 2. get xwininfo from the gcf's session and correct it by the above > factors > > Note that 1. can be done once only. > > Note this will work on X11 only. More portable way is that terminals > report > some GPVAL_ variables about their position on the desktop, but it > would just > increase the piping traffic and I doubt it's worth the effort. > > --- > PM Petr, I'm not following the Octave part. What are the correction factors to be determined by 1a,b,c? Regarding a flag to determine if the use changed the figure's position, we will need to find an approach that does not interfere with other backends. Meaning that setting and interpreting the flag should be isolated to the m-files supporting the gnuplot backend. I can do that if a gnuplot-only listener is assigned to the figure position property (i.e. the listener would store the last property specified by the user). Do you have another suggestion for how that might be done? In any event, when you reply, perhaps this discussion should be moved to Octave's list. Ben |