octave-maintainers
[Top][All Lists]
Advanced

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

Re: [RFC] octave-to-backend notification of property change


From: Michael Goffioul
Subject: Re: [RFC] octave-to-backend notification of property change
Date: Sat, 5 Jul 2008 22:33:53 +0200

On Sat, Jul 5, 2008 at 3:50 PM, Maciek Gajewski
<address@hidden> wrote:
>> DEFUN_UPDATER(figure, position, ...)
>> {
>>   // update figure window location
>
> It all depends what are expecting to get.
>
> If you want react only to few events, like: figure resizing, figure title
> change, ui control resizing and label change etc, that's fine.
>
> But it would be really great to have consistent notification mechanism, which
> could replace current 'redraw_figure' completely. I'd love to have interface
> like this:
>
> virtual void property_changed ( handle, name );
> virtual void object_created ( handle );
> virtual void object_deleted ( handle );
>
> This would allow me to react selectively to all events, without need to
> re-create entire GUI objects tree each time redraw_figure() is called.
>
> In my backend I have separate GUI object for each octave's graphic object. So
> property_changed would act like hub, identifying appropriate GUI object by
> it's handle and sent cross-thread notification to it.
>
> If we have each method called for each property, it would be like over 200
> separate notifiers! And event more after implementing uicontrols.
>
> And in multi-threaded backend they would all do the same: send message to GUI
> thread to update appropriate control.

The idea here is not to have such notifier for all objects and all
properties, but only for those that are *not*¨part of the rendering
process. That means only objects/properties related to GUI
elements. In the current graphics code, this only concerns
very few properties in figure class.

All the rest is handled by the rendering process in drawnow.
It wouldn't make sense to have notifiers for these properties,
because the only reaction is to redraw the figure content.
This is already handled by the "drawnow" function, which
checks if a figure has been modified and asks the backend
to redraw it if necessary.

>From what you say above, it seems that you're trying to
maintain in the GUI thread an object tree that is the image
of the object tree in octave, and that you would like to have
notifiers for all objects/properties in order to maintain your
image tree in sync with octave. This does not fit with the
current design in the graphics code, where the intention is
to have a backend to use directly the octave objects
(hence the required locking mechanism).

Michael.



reply via email to

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