|
From: | John Swensen |
Subject: | Re: How to launch Octave with its GUI ? |
Date: | Fri, 03 Aug 2007 08:45:12 -0400 |
User-agent: | Thunderbird 2.0.0.6 (Macintosh/20070728) |
John Swensen wrote:
Shai Ayal wrote: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 functionsOn 8/2/07, John Swensen <address@hidden> wrote:See my patch fromhttp://www.nabble.com/Proposed-patch-for-threadsafe-access-to-octave-internal-data-tf4080964.htmlNo 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. Shaioctave_rl_add_event_hook octave_rl_remove_event_hook octave_rl_get_event_hook_listThe 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
[Prev in Thread] | Current Thread | [Next in Thread] |