On Sat, May 5, 2012 at 10:39 AM, Oliver Sims
<[email protected]> wrote:
> I just discovered that an event handler method cannot be defined as PRIVATE.
> If it is, you get an ooDialog message saying the method name is not a method
> of the dialog.
>
> I guess it makes sense that the underlying event-handling code cannot invoke
> a private method. But am I correct? Or is this a bug in ooDialog?
No, it is not a bug, it is the way ooRexx works. As you have probably
figured out in your mind. You have an object, the ooRexx object that
is your dialog subclass. You can only invoke public methods on that
ooRexx object. This of course is no different than in any ooRexx
code:
m = .Miesfeld~new
m~fullName
m~secretName
::class 'Miesfeld'
::method fullName
say 'Mark Miesfeld'
::method secretName private
say 'Mr President, sir'
The underlying ooDialog implementation code has a reference to your
dialog subclass. It invokes the event handler by sending a message to
that dialog subclass object. It knows the *name* of the message
because you have to specify the name, (or use the default name,) in
your connectXXXEvent() method. If you supply a private method name,
then it won't work.
C:\work.ooRexx\wc\main.4.1.fixes\samples\windows\ole\apps>qt.rex
Mark Miesfeld
3 *-* m~secretName
Error 97 running
C:\work.ooRexx\wc\main.4.1.fixes\samples\windows\ole\apps\qt.rex line
3: Object method not fou
nd
Error 97.1: Object "a Miesfeld" does not understand message "SECRETNAME"
> If it's correct, then it would be useful (imho) to mention it in section
> 4.7.1."Coding Event Handlers".
> And if it's correct I'll certainly put a mention in the Guide.
Sure, it's worth mentioning. If it raised a question in your mind,
I'm sure there are other people starting out that would have the same
question.
--
Mark Miesfeld
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel