octave-maintainers
[Top][All Lists]
Advanced

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

Re: handle grapics with Document/View design


From: Brian Blais
Subject: Re: handle grapics with Document/View design
Date: Thu, 18 Aug 2005 11:27:13 -0400
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

John W. Eaton wrote:

One question I have about this approach is whether it is possible to
implement the "handle" object (apparently a specially encoded number)
that Matlab uses in the scripting language.  How do you take this
number and find the appropriate part of the data structure that
represents the handle graphics state?  I think you need to do this so
you can modify the global data structure given just the handle of a
small part of it.  It seems to me that this operation would be easy to
do in C++ because the number could be converted to a pointer into the
data structure.  But Octave does not have pointers, so it needs to be
done in some other way, perhaps by searching the structure for some ID
tags.

In my implementation of the gui for octave (at http://web.bryant.edu/~bblais/octave) I have just that: an octave structure array, and there is a "handle" field. Then I do:

  handles=[uiobjects.handle];
  idx=find(handles==h);

to find the actual index to the array.  It is pretty fast.

all of the set/get operations do the same thing.

                        bb
--
-----------------

            address@hidden
            http://web.bryant.edu/~bblais



reply via email to

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