Updating windows

In this section:

Many of the format codes of the winio@ function take pointers to data that may change. For example, the bar control variable in the %br (Bar) format will typically change as some time consuming process proceeds. Likewise, consider the following partial window definitions:

     CHARACTER*50 myform
     myform='TEST 1'
     i=winio@('%ca@&',myform)

The address of the variable myform has been passed to winio@, and if the contents of the string myform alter, it is desirable to update the window accordingly. In general, if you alter data that is in use by a window, the window will be updated if it is obscured and restored for any reason.

However, to obtain an immediate update, the subroutine

SUBROUTINE WINDOW_UPDATE@(variable)

should be called. The argument is the variable whose value has changed. In reality the address of the variable is passed and this address must be the exact address originally passed to winio@. For example, in the above example, the address of the first character in the string would be passed to WINDOW_UPDATE@ using

CALL window_update@(myform)

The update would not work if the address of the second character (i.e. myform(2:2)) where passed, even though this address points to part of the caption. The WINDOW_UPDATE@ function will update all controls, captions, etc. that depend on the variable. It may also be used with a grey-control variable (see for example %bt, Button format), or the control variable associated with the %lw (Leave Window Open) format. In the latter case, setting the control variable to a non-negative value means that the window will close.

Note that, in general, WINDOW_UPDATE@ will only update those objects that depend on the variable whose address is supplied. However, there is no guarantee that other portions of the display will not become updated in the process.

It is desirable that WINDOW_UPDATE@ be called at a sensible rate. Perhaps no more than once or twice per second for a given variable. Frequent updates may produce an unpleasant flicker.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited