|
From: | Robert T. Short |
Subject: | Re: terminology: handles, figures, objects, etc. |
Date: | Thu, 17 Sep 2009 15:16:46 -0700 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18 |
Michael D Godfrey wrote:
On 09/17/2009 06:45 AM, Robert T. Short wrote:Interesting. I can't imagine that ishandle would EVER return true for an object. My understanding is that most graphics objects are buried down in the program data space somewhere and you don't have direct access to them - thus the need for a handle. User-defined objects are owned directly by the creator and therefore have no need of a handle.A handle is a programmatic way to refer to the object. When it comes to the graphics stuff I am out of my depth, but handles are not objects in the stuff I have tried. Do you have some sample code where ishandle returns true for an object? Here is an example: octave:1> f1 = figure(1); % This creates a figure object. The handle is f1, but f1 is NOT an object. octave:2> ishandle(f1) % You can see this by using ishandle and isobject. The actual object is buried ans = 1 % in the octave dataspace, and you can't get it directly but you CAN manipulate octave:3> isobject(f1) % the properties through the handle. ans = 0 % Thus a handle is simple an opaque reference to the object. It could be an index % into a table, a pointer to an object, or anything else that makes sense to the % octave source. You don't know nor do you need to know what it really is. octave:4> gork = Gork(); % The Gork class is in the test directory. In this case gork is an object instantiated octave:5> ishandle(gork) % from the Gork class. You can manipulate the properties of the gork object directly ans = 0 % so there is no need for a handle. octave:6> isobject(gork) ans = 1 octave:7> class(f1) ans = double octave:8> class(gork) ans = Gork |
[Prev in Thread] | Current Thread | [Next in Thread] |