realbasic-nug
[Top] [All Lists]

Re: Accessing Subclass events

To: realbasic <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Accessing Subclass events
From: Barney <barney at custombased dot com>
Date: Wed, 01 Dec 2004 14:01:21 +1300
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thank you Will, Charles and Keith.

I am familiar with putting code in the event handlers
of a subclass.

I think below might be more what I'm after though you've
lost me there a bit keith sorry ... I'll explain further.

I have a httpSocket subclass in which I've defined a few of my
own methods and things to happen it some of it's event handlers.

Now I'd like to use it just in some code probably a module, not
a window. Consequently I can't drag it onto an interface so I can't
put code into any of the instances event handlers.

Ideally, when the instance has completed a download, I'd like to
take the received data, draw it to a graphics object and print it.

The most suitable place to start my print job would be in the page received
or download complete event BUT, I have no access to this in my instance.

I don't want to write this into the subclass as, for example, next time I
use this class I might not want to be printing but just get the data back
instead. Printing is not a feature of the subclass, only of the instance in
this case.

So is there any way to use an instances event when created in code only ?

I guess there is a number of ways to handle this, but I've often found
the need for this so this time I finally got around to posting the question.

Thank you.

Barney

  




on 1/12/04 12:34 PM, Keith Hutchison at
keith dot hutchison at balance-infosystems dot com wrote:

> dim InstanceName as ClassName
> InstanceName  = new ClassName
> InstanceName.DoSomething
> 
> Then you have to think about scope
> Create a property in the app,
> or a module, or window and store the InstanceName into that property
> 
> eg
> app.InstanceProperty = InstanceName
> window1.InstanceProperty = InstanceName
> module1.InstanceProperty = InstanceName
> 
> if you just need the instance for the scope of  the current  method
> then you don't have to worry  about storing the reference/instance.
> 
> Hope that  helps you
> 
> Keith Hutchison
> Balance-Infosystems.Com
> 
> postgresql - mysql - dbf
> Foxpro - Delphi - MS Access - REALbasic
> http://balance-infosystems.com http://realopen.org
>> Hi,
>> 
>> Is there any way to access the events of a subclass
>> without actually having a window to drag it onto
>> thereby being able to put code into an event handler.
>> 
>> Should you wish only to have the class in the project window
>> then create and use it only with code, how do you go about making
>> use of its events, as there is nowhere to put any code ?
>> 
>> Can this be done ?
>> 
>> Thanks
>> 
>> Barney
>> 
>> _______________________________________________
>> 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>
>> 
> _______________________________________________
> 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>
> 

_______________________________________________
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>