On 29-Jul-09, at 1:18 PM, Terry Ford wrote:
On Jul 29, 2009, at 11:42 AM, Norman Palardy wrote:
In an instance placed on a windows self refers to the window and me
refers to the instance on the window
In the code in a subclass, me and self refer to the instance (they
are synonyms)
Sometimes it is also helpful if one considers who owns the code or
control. That way, self always refers to the owner. If the code is
in an instance, the window owns it. If the code is in a subclass,
then the class owns it. If the code in a window control needs a
method or property in the subclass, it must refer to 'me.' to call
that code. Outside references must also refer to the window's
control directly as it inherited the method or property from its
super. This all depends on the scope that the method or property has
as well.
It can be confusing until one truly understands how it all works.
Very true this is a good way to think about it but the perception
seems to be that the code on an instance on a window is "owned by" or
is part of the control - that is until you understand that it isn't :)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|