Silverfrost Logo About Us | Contact Us
 

Updating windows

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 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 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.

 

 

Copyright © 1999-2017 Silverfrost Limited