Step 7:
Use the visual extension in an application
You do not need to declare an instance of a visual class or use
the CREATE statement to create an instance. The PBVM creates an instance
when the window or visual control in which the visual class resides is
opened, as described in Creating visual class
instances. You can invoke the object’s functions the same way
that you invoke a nonvisual object’s functions.
To use a visual extension:
-
Select File>Inherit from the PowerBuilder menu and select
the PBD in the Libraries list in the Inherit from Object dialog
box. -
Select the visual class and click OK.
-
In the User Object painter, size the visual object and make
any other changes you need. -
Save the object.
You can now drag the new user object from the System Tree directly
onto a window or onto another visual control, such as a tab control, and
use it like any other visual user object.
Code samples
The code fragments in the rest of this section are based on
complete sample applications that you can find on the PowerBuilder
Code Samples website at
https://community.appeon.com/index.php/codeexchange/powerbuilder.