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: Wed, 03 Apr 2013 21:36:57 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 04/03/2013 06:48 PM, John W. Eaton wrote:
For background info about what follows, please see the comments
attached to this patch tracker entry:

https://savannah.gnu.org/patch/index.php?7990

Dan, I agree that the add/remove_X_hook functions are ugly.

I checked in two changes that I hope will explain what I would like to
do instead. They are here:

http://hg.savannah.gnu.org/hgweb/octave/rev/70032fc70bee
http://hg.savannah.gnu.org/hgweb/octave/rev/169f71c9d9c8

The idea in those patches is to use the octave_link class more the way
I think it was intended. Octave calls methods from this class to
allow the GUI to handle things that happen in the interpreter like
gathering input, entering/exiting the debugger, or calling the edit
function at the command line. Since the octave_link class has pure
virtual functions, it can't work by itself. So the GUI needs to
provide some concrete implementation of those functions and we have
the calls to the GUI that we need. By using this class, we have a
clear definition of what Octave can ask the GUI to do.

My plan is to replace the remaining hook functions that are registered
in the octave_main_thread function with octave_link::calls instead.
Then I'll add new methods for the dialog functions so specialized
GUI versions can be called from the corresponding .m files. I still
think it makes sense to do the argument decoding in the .m files.

It would also be great if we can eliminate the octave_event_listener
class (or at least reduce its usage to to whatever is really
required for handling events while readline is waiting for input).

I checked in two more changes.

Then I noticed that the GUI was doing strange things when stepping in the debugger, including hitting errors while evaluating code and crashing randomly. I don't think this is due to my latest changes. I backed up to changeset 610e02bf9579 (prior to any of my octave-link changes) and although I haven't been able to trigger a crash yet, I am seeing evaluation errors when stepping.

If you'd like to try do duplicate this behavior, I'm able to trigger the errors by doing things like

  dbstop plot
  plot (rand (100,1), rand (100,1))

then either dbstepping rapidly at the command or with the step button on the editor. You can step quickly at the command line by entering "dbstep" once, then hitting return repeatedly to repeat the previous debug command.

jwe


reply via email to

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