Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Engineering

FIRSTSHOWN callback

  • Last UpdatedOct 27, 2022
  • 1 minute read

Typically assigned in the Constructor by:

!this.FirstShownCall = '!this.<form_method>'

The purpose is to allow you to carry out any form actions which can only be completed when the form is actually displayed. There are a variety of circumstances where this arises and it is often difficult to find a reliable solution. A couple of examples are given below.

Commands which manipulate form, menu, or gadget visual properties, executed from a PML macro, function or callback may not happen until control is returned to the window manager's event loop.

For example, in the application's start-up macro, the command sequence show !!myForm ... hide !!myform will result in the form not being displayed, but also not becoming known at all to the window manager. Attempts to communicate with this form via the External callback mechanism (possibly from another process) will not work. This can be rectified by doing the '!this.hide()' within the FIRSTSHOWN callback, because the form will be guaranteed to be actually displayed (and hence known to the window manager), before it is hidden.

It is sometimes difficult to achieve the correct gadget background color setting the first time the form is displayed. This can be resolved by setting the required color in the FIRSTSHOWN callback.

Related Links
TitleResults for “How to create a CRG?”Also Available in