octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52804] "Interruptible" and "BusyAction" prope


From: Rik
Subject: [Octave-bug-tracker] [bug #52804] "Interruptible" and "BusyAction" properties
Date: Fri, 5 Jan 2018 17:08:05 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #4, bug #52804 (project octave):

@Pantxo: Duh, you're quite right.  The BusyAction property is only for the
interrupting callback.  I did have another question, however.  As I read the
documentation, even when "Interruptible" is "on" an interrupting callback is
not executed immediately.  


When an object’s Interruptible property is set to 'on', its callback can be
interrupted at the next occurrence of one of these commands: drawnow, figure,
getframe, waitfor, or pause.

*    If the running callback contains one of these commands, then MATLAB stops
the execution of the running callback and executes the interrupting callback.
MATLAB resumes executing the running callback when the interrupting callback
completes.

*    If the running callback does not contain one of these commands, then
MATLAB finishes executing the callback without interruption.


If I understand that correctly, most callbacks will execute all the way
through because they are short and don't contain one of the five listed
commands.

A sample test case is attached as tst_interrupt4.m



close all;
graphics_toolkit qt

hl = line ();

lsn1 = @() disp ("line listener");

function lsn2 (h, evt, hl)
  disp ("begin axes listener");

  set (hl, "linewidth", get (h, "linewidth"));

  a = 1;
  a += 2;

  disp ("before drawnow");
  drawnow ();  % Should now run queued interrupts

  a += 3;

  disp ("end axes listener");
endfunction

addlistener (hl, "linewidth", lsn1);
addlistener (gca, "linewidth", address@hidden, hl});

disp ("Interruptible : ON");
set (gca, "linewidth", 2);
drawnow ();

disp ("\nInterruptible : OFF, BusyAction : QUEUE");
set (gca, "interruptible", "off");
set (gca, "linewidth", 3);
drawnow ();

disp ("\nInterruptible : OFF, BusyAction : CANCEL");
set (hl, "busyaction", "cancel");
set (gca, "linewidth", 4);
drawnow ();



The results under Octave show that any interrupting callback is executed
immediately.


Interruptible : ON
begin axes listener
line listener
before drawnow
end axes listener

Interruptible : OFF, BusyAction : QUEUE
begin axes listener
before drawnow
end axes listener
line listener

Interruptible : OFF, BusyAction : CANCEL
begin axes listener
before drawnow
end axes listener




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52804>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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