[changeset] - improve clf() compatibility

David Bateman David.Bateman at motorola.com
Fri Oct 31 08:58:39 CDT 2008


David Bateman wrote:
> John W. Eaton wrote:
>> On 22-Oct-2008, David Bateman wrote:
>>
>> | 2) The correct solution is to have a means of removing callback | 
>> functions in the deletefcn of plotyy. So we need a dellistener 
>> function | that corresponds to the existing addlistener function.. 
>> I'm working on a | patch along these lines.
>>
>> The Matlab docs indicate that calling delete on the handle returned by
>> addlistener should delete the object remove the listener function.  It
>> looks like Matlab creates a "handle class object" to represent the
>> listener function.  I know, we don't have "handle class objects".
>> Maybe we need to fake something for now, but it seems we should at
>> least use the same interface if possible instead of introducing a new
>> dellistener function.
>>
>> jwe
>>
>>   
> In fact the problem is that "newplot" calls __go_axis__init__ which 
> reinitializes the axis but keeps the listeners. Deleting the axis does 
> correctly delete the listener functions. From that point there are two 
> choices, make __go_axis_init__ (ca, "replace") search all of the axis 
> properties for listeners are remove them.. Or alternatively, delete by 
> hand the callbacks elsewhere.. It probably makes sense to do both..
>
Coming back to this issue that was never resolved, I now think the best 
thing to do here is a change to graphics.cc 
(axes::properties::set_default) such that it removes all listeners from 
all properties of the axis. The attached patch does this but keeps the 
idea of a dellistener function that complements the addlistener 
function. Finally, there is a couple of other corrections that allow all 
of the tests of rundemos("plot") to complete successfully.

Regards
David



-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch8788
Url: https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081031/452eb80c/attachment.ksh 


More information about the Octave-maintainers mailing list