octave-maintainers
[Top][All Lists]
Advanced

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

Re: Connecting Octave to the GUI


From: John W. Eaton
Subject: Re: Connecting Octave to the GUI
Date: Mon, 08 Apr 2013 16:31:34 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 04/08/2013 04:15 PM, Daniel J Sebald wrote:

1) Some method of installing Octave builtin functions that can override
the present builtin functions and still access the core builtin
functions. This is analogous to the C++ inheritance concept. Say the C++
code for the GUI that sets up builtins is something like:

octave_link = launch_octave_in_another_thread ();
/* INSTALL */
octave_link->install_octave_command ("dbstop",
octave_link::qt_dbstop_routine);
octave_link->install_octave_command ("dbclear",
octave_link::qt_dbclear_routine);
octave_link->install_octave_command ("dbcont",
octave_link::qt_dbcontinue_routine);
etc.

for which an example routine might be:

octave_value_list
octave_link::qt_dbstop_routine (varargs, etc.)
{
/* ACCESS CORE */
octave_value_list retval = corefeval ("dbstop", varargs, etc.);

// Now interpret the retval and its ramifications on Qt GUI elements.
if (retval[0].is_numeric ())
{
QString filename = varargs[0].string_value ().c_str();

// Found a valid breakpoint.
emit add_breakpoint (filename, retval[0].int_value());
}

return retval;
}

The above code needs no callbacks, hooks, etc. Just the
install_octave_command() and corefeval() routine.

This sort of approach could possibly work, but I'm not interested in reworking things this dramatically now. The way the octave_link class is currently designed seems to work. Let's stick with the current approach for now. Once we have most of the functionality in place, we can revisit whether there is a better way of handling the link.

jwe



reply via email to

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