1. Jason Lipman
  2. PowerBuilder
  3. Monday, 4 April 2022 20:02 PM UTC

Here's a fun one to solve...

I am blending a new report-running process with an old. I have no control over the old, and I want to center the Response windows (used for arguments) that are popped up.

The window names are stored in a table and dynamically opened per the example OpenWithParm shown below.
Then I want code in the "POST ue_center_lwin()" event to determine the name of the Response window and center it.

Posting ue_center_lwin() does seem to correctly run after the Response window opens.

This is not like looping the names of open sheets. I need to determine the name of the response window so I can do "lwin.Center = True", or anything else to it after it opens and before I've closed it to continue the code flow..

----------------------------------------------------
String ls_window_classname
Window lwin

ls_window_classname = // value from the database

This.Event POST ue_center_lwin()
OpenWithParm(lwin, dw_1, ls_string_assigned_to_lwin)
----------------------------------------------------

Any thoughts?

Thanks,
Jason

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Monday, 4 April 2022 21:01 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Jason - 

How 'bout this?

Instead of using a variable with local scope ("lwin"), use an instance variable, "iwin"?. The OpenWithParm method will assign a reference to the opened response window in the iwin instance variable. When the posted uf_center_lwin function executions, it can access iwin and manipulate the response window.

HTH, John

Comment
  1. Jason Lipman
  2. Monday, 4 April 2022 21:10 PM UTC
Great idea to go 'Instance' I'll try it and let you know if it works. :)
  1. Helpful
  1. Jason Lipman
  2. Monday, 4 April 2022 21:16 PM UTC
Great idea, John. It is working. Thanks for that.

Jason
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.