GpiSetStopDraw: Difference between revisions
mNo edit summary |
|||
Line 42: | Line 42: | ||
==Example Code== | ==Example Code== | ||
This example shows how to stop drawing. | This example shows how to stop drawing. | ||
<pre> | <pre> | ||
#define INCL_GPICONTROL | #define INCL_GPICONTROL | ||
#include <OS2.H> | #include <OS2.H> |
Revision as of 10:58, 4 April 2025
This function sets or clears the "stop draw" condition.
Syntax
GpiSetStopDraw(hps, lValue)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lValue (LONG) - input
- Stop draw condition.
- SDW_OFF - Clear the "stop draw" condition
- SDW_ON - Set the "stop draw" condition
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE - Successful completion
- FALSE - Error occurred
Errors
Possible returns from WinGetLastError
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_INV_STOP_DRAW_VALUE (0x20CF)
- An invalid value parameter was specified with GpiSetStopDraw.
- PMERR_INV_MICROPS_FUNCTION (0x20A1)
- An attempt was made to issue a function that is invalid in a micro presentation space.
Remarks
This function allows an application to set up, and control, an asynchronous thread on which long drawing operations may be performed. At the point at which the controlling thread stops a draw, it sets the "stop draw" condition. The controlling thread clears this condition after it has received an acknowledgment from the drawing thread.
The "stop draw" condition has no effect on any other calls.
If one of the following calls is made (or has already been initiated from another thread) to the same presentation space, the call is terminated if the "stop draw" condition exists:
- GpiDrawChain
- GpiDrawDynamics
- GpiDrawFrom
- GpiDrawSegment
- GpiPlayMetaFile
- GpiPutData
The call terminates with a warning.
Any call other than GpiSetStopDraw, directed at a presentation space that is currently in use, gives a PMERR_PS_BUSY error condition.
Note: If this function is issued when an asynchronous draw to a metafile is taking place, the result is an unusable metafile.
Example Code
This example shows how to stop drawing.
#define INCL_GPICONTROL #include <OS2.H> HPS hps; /* Presentation-space handle. */ GpiSetStopDraw(hps,SDW_OFF);
Related Functions
- GpiDrawChain
- GpiDrawDynamics
- GpiDrawFrom
- GpiDrawSegment
- GpiPlayMetaFile
- GpiPutData
- GpiQueryStopDraw