realbasic-plugins
[Top] [All Lists]

Re: Subclassing Window

To: "Mars Saxman" <mars at realsoftware dot com>, "REALbasic Plugins" <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Subclassing Window
From: "Ross at Webwolves" <ross at webwolves dot com>
Date: Tue, 31 May 2005 14:38:05 -0700
Cc:
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <BE8953C0 dot C666%vanhoek at mac dot com> <036501c56625$d6abbed0$6601a8c0 at whoscalling dot net> <F85F5467-9D8F-4560-9C9E-DF3C8CE07D32 at realsoftware dot com>
Hi Mars!

Where does the Open event you see in FrmMain come from?

Uh, well (sheepishly)... true confessions time. :-) The truth of the matter is that FrmMain used to be a Window. Thus Open used to be the Open event of the Window class. Then I tried to get a little smarter and implement some functionality common to all my windows in DPWindow. That much is working nicely. But I still need to percolate an Open event back to FrmMain.Open if I can.

However, the syntax is escaping me. Or something else is, I dunno. :-)

== Ross ==


----- Original Message ----- From: "Mars Saxman" <mars at realsoftware dot com> To: "Ross at Webwolves" <ross at webwolves dot com>; "REALbasic Plugins" <realbasic-plugins at lists dot realsoftware dot com>
Sent: Tuesday, May 31, 2005 2:30 PM
Subject: Re: Subclassing Window



On May 31, 2005, at 2:15 PM, Ross at Webwolves wrote:

RB-ers,

I have created a class, DPWindow, that has Window as its super class. DPWindow's constructor includes this code:

    // call the Window constructor, or Open events will not fire
    Super.Window()

DPWindow includes an Open event that does some housekeeping.

Now, I have created a window in my application called FrmMain, and its type is DPWindow. FrmMain has an Open event, too. Unfortunately, it is not getting called. The DPWindow class Open event is being called, which makes sense, but how can I get the FrmMain.Open to be called, too?

Where does the Open event you see in FrmMain come from? If DPWindow declares it, then DPWindow needs to invoke it. You say that DPWindow implements the Open event it inherited from its superclass, so that would be a good time to call the Open event it declared for its subclasses to implement.

Mars Saxman
REAL Software



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>