On Fri, Jan 25, 2013 at 8:58 AM, Staffan Tylen <staffan.tylen@gmail.com> wrote:

I think you are making this too complicated.  Just invoke the method directly

Process A:
b = .B~new

Process B:
do something

Doing this I get:

Error 97.1:  Object "a Message" does not understand message "METHOD1"

But I also realise that my sample above is not reflecting the code sequence correctly, it should be:

Well that makes a major difference.  ;-)

Still what I said stands.  You are making this too complicated.  You don't want to use the returned message object, you want to use the dialog object you instantiated.  Not only because trying to use the message object is too complicated, but also because it won't work.

Do this:

Process A:
bDlg = .B~show

Process B:
tv = self~new
   return tv
::METHOD method1
do something

I looked at the doc for the popup and popupAsChild methods and just added some clarifying text:

Note that the example shown below for the popup method makes use of the returned Message object to illustrate a possible use of the return. However, it is a contrived use case. Typically it is easier to just work with the instantiated dialog object directly.  (In the case of the example this would be the dlg variable.)

One of the major problems I had with the original ooDialog documentation was that the return value from most methods was not documented.  And the few times it was, it was often not documented correctly.  So, when I began rewriting the docs one of the objectives was to always document what was returned.  In the case of these 2 methods, I added an example that could show a possible use of the return.  But, the example was not meant to imply that you should use the return.

In your case, what you want to do is invoke a method on the Dialog object.  You can't do that by invoking a method on the Message object.  But, it is very easy to invoke a method of the dialog object if you have a refence to it.  ;-)

Mark Miesfeld