Advanced PowerBuilder

HomePrevious Lesson: Polymorphism in PowerBuilder
Next Lesson: Function Overloading

Sending Messages

If you look at the PowerBuilder system class hierarchy, you'll see that PictureButton control is inherited from the CommandButton control. This makes sense, as both perform the same function.

Whenever you click a CommandButton, the script for the clicked event is executed; the same is true for a PictureButton. Since both are in the same polymorphic family, there is no need to call different event names for each of them. They can have the same event, but execute different script. This is polymorphism in practice - the same event is called in both cases, but the script that is to be executed is passed like a parameter to the executing function, depending on the control being clicked.
HomePrevious Lesson: Polymorphism in PowerBuilder
Next Lesson: Function Overloading