octave-maintainers
[Top][All Lists]
Advanced

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

Re: How to launch Octave with its GUI ?


From: Shai Ayal
Subject: Re: How to launch Octave with its GUI ?
Date: Sat, 4 Aug 2007 08:01:17 +0300

This patch looks just like we needed. I have 2 "stylistic" comments:

* Why do you use a fixed size array? if you use std::vector it would
greatly simplify your code since adding and removing elements is done
for you.
* instead of using printf to print error messeges, use the error function.

Shai

On 8/3/07, John Swensen <address@hidden> wrote:
> John Swensen wrote:
> > Shai Ayal wrote:
> >> On 8/2/07, John Swensen <address@hidden> wrote:
> >>
> >>> See my patch from
> >>> http://www.nabble.com/Proposed-patch-for-threadsafe-access-to-octave-internal-data-tf4080964.html
> >>>
> >>> No one ever commented on it, so for the time being I am just going to
> >>> put it in my program and register for the octave_rl_event_hook()
> >>> callback to determine when octave is idle at the prompt.
> >>>
> >>
> >> I have a feeling that the rl_event_hook is going to be heavily used in
> >> the near future by several in-the-works GUI components. I suggest we
> >> implement a mechanism which will allow several hooks to be registered
> >> at once.  I will try to implement this, but it will take me sometime,
> >> so if anyone can do it faster, please do.
> >>
> >> Shai
> >>
> >>
> > Here is a patch for allowing multiple "users" to register with the
> > rl_event_hook.  I basically made a toplevel event_hook function that
> > resides in oct-rl-edit.cc and in turn calls all other registered
> > event_hook functions in the order they were registered.  I added the
> > functions
> > octave_rl_add_event_hook
> > octave_rl_remove_event_hook
> > octave_rl_get_event_hook_list
> >
> > The part I am not 100% sure about is the changes I made to
> > cmd-edit.cc.  They work fine for what I am doing, but I am not sure
> > how these are used elsewhere.  I simply made the do_set_event_hook()
> > function call the octave_rl_add_event_hook() function and the
> > do_restore_event_hook() call octave_rl_remove_event_hook() with the
> > most recently added event_hook.  Probably not the best method, but am
> > open to suggestions from someone who has a better understanding of the
> > cmd-edit.cc file and the gnu_readline class.
> >
> > John Swensen
> I was just wondering if anyone has comments (or acceptance) of this
> patch.  I believe it does exactly what was asked (e.g. allow multiple
> people to register for the rl_event_hook callback.
>
> John
>
>


reply via email to

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