Re: bindevent() requires source event code ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Eugene Vital (dontwantany_at_news.com)
Date: 03/25/05


Date: Thu, 24 Mar 2005 19:10:00 -0500

gerry wrote:
> vfp9
> I have a control that is added to a form , in it's INIT() method it issues
> BIND.EVENT(this.parent,"Destroy",this,"OnDestroy")
> if there is any code at all ( even a single "*" ) in the forms
> form.Destroy() method, the control.OnDestroy() delegate is called as
> expected
> however if the form.Destroy() method is empty the delegate is never called
> why does the source object have to override the event in order for bound
> events to fire ?
> anyone have a generic work around that would not required dummy Destroy()
> code to exist ? If I am going to have to add this dummy code I might as
> well just call control.OnDestroy() myself.
>
> Gerry
>

        Yes, to work around this put some code or comments in your base class
Destroy() method . This is what is in the Destroy() event of all my base
classes.

*=========================================================================
* Library:
* Class:
* Method: Destroy()
* Dependancies:
* Scope: Public
*=========================================================================
* Description: stadard Destroy()
*=========================================================================
* Parameters: none
* Example:
* Returns:
* Comments: If you use BINBDEVENT() to bind an event to the Destroy()
* method it won't execute if there isn't any code to execute in the
* Destroy() event. It will execute however if there are comments here :)
*=========================================================================

        



Relevant Pages

  • Re: Removing Objects from Memory VFP 9.0
    ... CREATEOBJECTas my error processor. ... I Execute This.oErrorObject.Destroy where the ON ERROR is reset ... The ErrorClass remains in memory. ... calling the object's Destroy method. ...
    (microsoft.public.fox.vfp.forms)
  • Re: BindEvent()
    ... > As long as the delegate or the event-source are available you can use the ... > AEVENTS() function with the object as 2nd parameter: ... > This will fill an array with all bindings for the passed object. ... How did you find out that FoxPro doesn't destroy the delegation? ...
    (microsoft.public.fox.vfp.forms)
  • Re: POSIX thread question
    ... Jack wrote: ... The 10 threads can not destroy the cntr_mutex ... have any pickles. ... You are correct that your threads do not execute main and hence do not ...
    (comp.os.linux.development.system)
  • Re: properly destroying a widget
    ... The message details are below. ... Note that the widget named ... After you destroy it, the other ... > bindtags attempt to execute, ...
    (comp.lang.tcl)
  • Re: destroy . stumper
    ... After yours has been executed (destroy .), ... doesn't exist anymore. ... Esc and Ctrl-x have no additional bindings, ...
    (comp.lang.tcl)