Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Passing data to an open child window

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Passing data to an open child window
#12190
Posted by: cliff 2008-01-03 00:55:07
I have an app that will open a child window and do some processing.
The user can go back to the parent and select data that I'd like to pass back to
the still open child window to process.

I can't figure out how to do this. Is it even possable? 

thanks,
cliff:-)
cliff:-)
Message2.
#12191
Posted by: Jeff Glatt 2008-01-03 05:04:48
I presume that you've created the child non-modal.

In that case, your call to GuiGetMsg() handles the operation of both windows simultaneously. If the enduser manipulates a control in the main window, it will call the appropriate event handler(s) in the main script. If the enduser uses a control in the child window, it will call the appropriate event handler(s) in the child script.

Since it's the operation of some main window control that initiates the action, then you need some handler in the main script to catch that action. The handler should test if the child script is running. If so, it should then call some function you put in the child script. That child function will do whatever it is you need to do.

For example, maybe you have a main window button that calls WM_CLICK_Something. And you've created a child object associated with the variable MyChild.
wm_click_something:
   /* Check if the child script is running. If so, the object variable
    * "MyChild" should not be dropped.
    */
   IF EXISTS("MyChild") THEN DO

      /* Call the child script function DoSomething, and pass it the
        * string "Hello". Store its return in "ret".
        */
      ret = mychild~dosomething("Hello")

   END
   RETURN
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2021-4-14  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0