Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making custom visual

Status
Not open for further replies.

Negator

Programmer
Oct 4, 2003
33
RU
Hello PowerBuilder wizards!

I made a Custom-Visual userobject (with three buttons: OK,Cancel,Apply).

How can I reference the host window from the Cancel button to close it?

Thanks!
 
create an instance variable of type window on the uo. Set the variable when the host window invokes the uo then use the reference for method calls.
 
Thank you!

Please make me a tip: what do you mean "invokes"? For now i made a function Init with window argument, which must be called from the window manually.
It's pretty bad.

Is it possible to catch the window reference in the userobject itself?

I believe you understood me. Sorry for my poor english.
 
host window code:

uo_whatever iuo_whatever
iuo_whatever = CREATE uo_whatever

This is invoking (creating) the object. It could be in the open event of the window (or somewhere else if you want).

Then code this on the window:

iuo_whatever.iw_parent = THIS

This sets the 'link' between the window which created the uo and the uo. This assumes you have an instance variable on the uo of type 'window' called 'iw_parent'.

Now you can trigger events or call methods on the parent via a dynamic call. example: 'iw_window.event dynamic ue_myevent()'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top