[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57319] legend() fails after being repeadetly
From: |
Pantxo Diribarne |
Subject: |
[Octave-bug-tracker] [bug #57319] legend() fails after being repeadetly called (show/off) after plotyy |
Date: |
Tue, 3 Dec 2019 05:17:26 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 |
Follow-up Comment #10, bug #57319 (project octave):
@Rik: Pause was not meant to introduce a delay, but rather to force processing
graphics events. I still cannot reproduce the "execution error ..." but after
playing with plotyy in uipanel I can confirm that processing graphics events
is not enough to avoid infinite execution of callbacks. I think the base
problem boils down to the following example:
figure (567); clf;
hp = uipanel ();
hax = axes ("parent", hp);
function updater (h, ~)
persistent updating = false;
if (! updating)
units = get (h, "units");
updating = true;
unwind_protect
disp updating
set (h, "units", "points", "units", units)
unwind_protect_cleanup
## pause (0.01) # process events
updating = false;
end_unwind_protect
endif
endfunction
addlistener (hax, "tightinset", @updater)
addlistener (hax, "position", @updater)
set (gcf(), 'position', [50 50 350 315]);
The above script results in an infinite series of callback execution. Since
this is not recursive, the "updating" variable is always false and we cannot
do anything to stop the execution (except closing the figure with the X
button). Without the uipanel, the above is properly stabilized by the
"updating" variable.
Now adding the pause and increasing the time laps increases the probability of
stopping the execution but this is clearly unreliable.
Fixing this properly now looks like much work than I had foreseen.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57319>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/