Consultor Eletrônico



Kbase 18057: LOAD-MOUSE-POINTER problems - try SESSION:SET-WAIT-STATE
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/26/1998
LOAD-MOUSE-POINTER problems - try SESSION:SET-WAIT-STATE

Please note: this kbase applies to GUI interfaces only, such as
MS-Windows. It does not apply to character-mode PROGRESS.

Many programmers wish to change the cursor to an hourglass while
program processing is underway. For example, while a report is being
generated and output to a file or printer, it is important that the
user get a visual cue that further input to the application is
suspended. (This arises out of the fact that the PROGRESS architecture
is single-threaded, meaning that PROGRESS is unable to do other
processing in parallel with report generation, etc.)

One way programmers choose to change the cursor is LOAD-MOUSE-POINTER.
The problem with this approach is that LOAD-MOUSE-POINTER changes the
appearance of the pointer but does not actually disable input to the
application interface. The SESSION method SET-WAIT-STATE accomplishes
this as part of its default behavior.

An example of SESSION:SET-WAIT-STATE( ) is the following:


DEF VAR stat AS LOGICAL.
DEF VAR i AS INT.

ON "CHOOSE" OF button-1 DO:
stat = SESSION:SET-WAIT-STATE("general").
DO i = 1 TO 200:
DISPLAY "Hello".
END.
stat = SESSION:SET-WAIT-STATE("").
END.


Note that the button trigger code resets the wait state to default
following the DISPLAY loop. This is critically important since
otherwise the user can be locked out completely. Similarly, any use
of the "general" wait-state MUST be followed by a guaranteed reset
to the default state.