Subclassing a Window in REALbasic

In REAL Studio 2010, a window cannot inherit from another window. But a window can inherit from a class whose "Super" is set to "Window".

For example, if you want to track each individual window, you could add assign a UUID to each window instance. That UUID value could be stored as a hex string in a property on each window. Rather than create the property on each window definition (Customer window, Purchase Order window, etc.), let those window definitions inherit the UUID property.

(1) Add a class (not a Window) named "UuidWindow".

(2) On that class, set it's "Super" property to "Window".

(3) On that class, add a property named "UUID" of type String.

(4) Open each of your window definitions (Customer window, Purchase Order window, etc.) and change their "Super" property to "UuidWindow".

Now each of those windows can refer to "me.UUID".

No comments:

Post a Comment