How to create a callback of a method inside a Class ?
1 post
• Page 1 of 1
How to create a callback of a method inside a Class ?
With the following :Namespace
If I type Test1.Make and close the Form created I will get the expected message from the onClosing handler (Form of Namespace Test1 is closing).
Now with the following :Class that is identical to the previous :Namespace
If I do test2 ← ⎕new Test2 and close the Form created I will get the error: Method not found FormClosingEvent.
What do I need to do for :Class callback to find the method inside the class that it was created from ?
Thanks in advance.
- Code: Select all
:Namespace Test1
:Using System.Windows.Forms,System.Windows.Forms.dll
∇ Make
:Access Public
form←⎕NEW Form
form.Text←'Form of Namespace Test1'
form.add_Closing(⎕OR'FormClosingEvent')
form.Show ⍬
∇
∇ FormClosingEvent(sender event)
:Access Public
sender.Text,' is closing'
∇
:EndNamespace
If I type Test1.Make and close the Form created I will get the expected message from the onClosing handler (Form of Namespace Test1 is closing).
Now with the following :Class that is identical to the previous :Namespace
- Code: Select all
:Class Test2
:Using System.Windows.Forms,System.Windows.Forms.dll
∇ Make
:Access Public
:Implements Constructor
form←⎕NEW Form
form.Text←'Form of Class Test2'
form.add_Closing(⎕OR'FormClosingEvent')
form.Show ⍬
∇
∇ FormClosingEvent(sender event)
:Access Public
sender.Text,' is closing'
∇
:EndClass
If I do test2 ← ⎕new Test2 and close the Form created I will get the error: Method not found FormClosingEvent.
What do I need to do for :Class callback to find the method inside the class that it was created from ?
Thanks in advance.
-
PGilbert - Posts: 440
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
1 post
• Page 1 of 1
Return to Object Oriented Programming
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group