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: Thu, 4 Jan 2018 22:51:57 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

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

This is important so I pushed the cset here
(http://hg.savannah.gnu.org/hgweb/octave/rev/a56d283ff18a).

However, I still don't think it is handling a BusyAction of Cancel correctly. 
In my understanding, the interrupting callback is simply discarded and never
executed.  However, in Octave Queue and Cancel produce the same results.  I
modified your test script to create tst_interrupt2.m which is attached.


close all;
graphics_toolkit qt

hl = line ();

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

function lsn2 (h, evt, hl)
  disp ("begin axes listener");
  set (hl, "linewidth", get (h, "linewidth"));
  disp ("end axes listener");
endfunction

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

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 (gca, "busyaction", "cancel");
set (gca, "linewidth", 4);
drawnow ();


The results are 


tst_interrupt2
Interruptible : ON
begin axes listener
line listener
end axes listener

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

Interruptible : OFF, BusyAction : CANCEL
begin axes listener
end axes listener
line listener


The BusyAction property doesn't seem to make a difference.  I believe this is
because there may be a way to execute a callback directly after a property is
modified in this routine


void
callback_property::execute (const octave_value& data) const
{
  octave::unwind_protect frame;

  // We are executing a callback function, so allow handles that have
  // their handlevisibility property set to "callback" to be visible.

  frame.add_method (executing_callbacks, &callback_props::erase, this);

  if (! executing_callbacks.contains (this))
    {
      executing_callbacks.insert (this);

      if (callback.is_defined () && ! callback.isempty ())
        gh_manager::execute_callback (get_parent (), callback, data);
    }
}


This documentation was useful on how the property should behave:
https://www.mathworks.com/help/matlab/creating_guis/callback-sequencing-and-interruption.html.



(file #42840)
    _______________________________________________________

Additional Item Attachment:

File name: tst_interrupt2.m               Size:0 KB


    _______________________________________________________

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]