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

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

[Octave-bug-tracker] [bug #50295] Calling feval() from within the Qt GUI


From: Roland Baudin
Subject: [Octave-bug-tracker] [bug #50295] Calling feval() from within the Qt GUI requires to press enter otherwise the prompt is busy
Date: Mon, 13 Feb 2017 11:24:13 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux i586; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/bugs/?50295>

                 Summary: Calling feval() from within the Qt GUI requires to
press enter otherwise the prompt is busy
                 Project: GNU Octave
            Submitted by: roland65
            Submitted on: Mon 13 Feb 2017 04:24:12 PM UTC
                Category: GUI
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I tried to add a new menu item to the figure window of the qt graphics
toolkit, to call an Octave function from the figure window.

I used the following code in libgui/graphics/Figure.cc:

void
Figure::createFigureToolBarAndMenuBar (void)
{
   <...>

  editMenu->addSeparator ();
  editMenu->addActions (m_mouseModeGroup->actions ());
  editMenu->addAction (tr ("&My function"), this, SLOT (myFunction (void)));

  < ... >
}

void
Figure::myFunction (void)
{
    octave_link::post_event (this, &Figure::myfunction_callback);
}

void
Figure::myfunction_callback (void)
{
  figure::properties& fp = properties<figure> ();
  octave_value fnum = fp.get___myhandle__ ().as_octave_value ();

  Ffeval (ovl ("disp", fnum));
  //feval (ovl ("fprintf",1,"example\n"), 1);
}


This silly example should display the figure id in the command window (of
course the real function will do much more).

This almost works (to test, plot anything and click on the Edit / My function
menu item), but after the figure id is displayed in the command window, the
prompt gets stuck and I have to type <enter> to get the prompt back again.

Same behaviour with the fprintf() function (see the commented line above)...







    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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