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

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

[Octave-bug-tracker] [bug #48175] "parse error" error message in GUI cal


From: Rik
Subject: [Octave-bug-tracker] [bug #48175] "parse error" error message in GUI callbacks
Date: Thu, 9 Jun 2016 17:30:19 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of bug #48175 (project octave):

                Severity:              3 - Normal => 1 - Wish               
                Priority:              5 - Normal => 4                      
              Item Group:                    None => Feature Request        

    _______________________________________________________

Follow-up Comment #3:

Changing this report to a Feature Request and lowering the Severity and
Priority.  Octave behaves equivalently to Matlab, except the error message is
less informative.

I don't know if it can be fixed, but the place to fix it will be in
libinterp/corefcn/graphics.cc.  The function in question is
gh_manager::do_execute_callback().  If the callback is a string, then
eval_string is called, if it is anything else then feval is called.

Interestingly, there are differences between eval_string and feval.  The
example in comment #0 used a string for the callback.  The following code uses
a function handle.



close all;
h = figure;
fcn = @() error ("My Error Msg");
uicontrol(h,'style','pushbutton','callback', fcn);


Just for grins, I put the feval in do_execute_callback inside a try/catch
block.  

if (fcn)
  {
    try
      {
        feval (fcn, args);
      }
    catch (...)
      {
        error ("Error executing callback\n");
      }
  }


And running now produces


tst_cb_err
error: My Error Msg
error: Error executing callback
error: parse error


It works to produce the new error message, but I also get a "parse error"
message.  This must be coming from the parser itself in
parse-tree/oct-parse.cc




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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