|
From: | Brian Blais |
Subject: | Re: handle graphics with Document/View design |
Date: | Thu, 18 Aug 2005 13:05:27 -0400 |
User-agent: | Mozilla Thunderbird 0.8 (X11/20040913) |
John W. Eaton wrote:
On 18-Aug-2005, Brian Blais wrote:| 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.So all the uiobjects are in a flat structure array?
yes, I did this for ease of implementation. I make no claims that it is the ideal way of doing it.
What if the set of uiobjects is arranged in a tree structure, where one uiobject might have other uiobjects as children? Then I don't think the find trick is enough. In that case, wouldn't you need to search through the tree recursively, looking at each set of children in the uiobject tree?
I think that is correct. I don't know how fast that would be. at the time of my implementation, I was just trying to get *something* to work. I've been able to do quite complex interfaces with my implementation, and it is very similar to the syntax for matlab. in my implementation, the objects do have children, but they are simply handles which then get changed to indices into a flat array.
bb -- ----------------- address@hidden http://web.bryant.edu/~bblais
[Prev in Thread] | Current Thread | [Next in Thread] |