octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnuplot terminal size & position


From: Benjamin Lindner
Subject: Re: gnuplot terminal size & position
Date: Wed, 16 Feb 2011 16:08:32 +0100

> The flickering for x11/wxt occurred because gnuplot deleted the old window 
> and created a new one. I'd expect the same behavior for windows, but don't 
> know if that is the case.

It doesn't seem to do this for windows.

>> That depends on what you'd define "updated".
>
> Anything that causes the plot to be redrawn. What happens for ...
>
> plot (0:1)
> hold all
> # reposition / resize window with the mouse
> plot (-1:0)
>
> ... My experience is that the size and position of the figure window will 
> revert to that specified by the figure's "position" property.

Ah, I get it. No it doesn't change either size or position.
But that's because I added the aforementioned
check-against-the-last-known-position code, and for octave, the window
has neither moved nor changed its size, so it does not re-issue a
"size" or "position" option to gnuplot. It only does if you call
set(h, 'position', foo) and either the position has changed or the
size has changed from the last call of set(h, 'position', foo).
I attached what I changed so far if you're curious.

>
> Its been a while since I worked on this. I don't recall if I tried to handled 
> the size and position separately.

For the windows terminal, the patch is pending on gnuplot's mailing
list. If you'd want to check it, you'd have to build from recent CVS
yourself.

>> Now currently there is no way to use this functionality from octave,
>> because octave cannot determine if I only want to change the size or
>> only want to change the position.
>>
>> I currently do a check-against-the-last-known-position/size approach
>> (used in the example code above), but, again, octave is ignorant of
>> manual moves, so this is not really satisfactory.
>
> Detecting whether the window has been manually repositioned or resized is the 
> only problem I see. If the window were deleted and redrawn in those cases, I 
> don't think anyone would mind. However, how do we make sure the "position" 
> property reflects the windows current position and size? The recent gnuplot 
> does give us access to the x11 ID for the windows. Can that be used to 
> trigger an update to the "position" property when the window's position/size 
> is changed? ... can the same be done for the window's terminal? (it cannot 
> for aqua).

Does this mean that separate "size" and "position" figure options are
not a problem? (I feared that this would raise loud opposition).
That'd be half the problem's solution, actually that would /be/ the
problem's solution.

Detecting manual movements currently is not possible, I agree. (I
think it should be possible to do so if you either ask gnuplot - but
the it would have to be implemented there - or ask the OS if you know
the window handle. I could do a quick hack to check it this is
possible for windows...)
But detecting manual movements is only required if you want to read
out the current position, but you don't need the current position to
specify a new position /if/ there is a way to signal that a new
position is requested (vice versa for the size) and there you're back
at the separate "size" and "position" options (or whatever other way
to implement it).

So, yes, it would be cool if I could read out the current window's
position. But then again, this would mirror only the position on the
screen, not the actual size of the window - the window on screen is
larger than what you specify with "set term windows size x,y". here
x,y is the canvas size (like in all printout terminals), and the
actual window on screen is larger (it includes e.g. a status bar, a
caption bar, possibly a toolbar, and borders).
Which size would you then reflect in octave? The size the OS will tell
you is the window size, not the canvas size. So setting the size as
e.g. [400,300] and then reading the window's (screen) size will yield
a larger window size.

benjamin

Attachment: gnuplot_windows_sizeposition.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]