PtHold, PtRelease

PtHold, PtRelease — hold/release the issue of all Photon events to the Photon server.

Syntax

PtHold ()
PtRelease ()

    

Arguments

none

Returns

A global hold count value.

Description

PtHold prevents all Photon events from being issued to the Photon server. This is useful when a program makes a large number of changes to either overlapping widgets or widgets contained in the same container. Using PtHold can prevent the container from being re-drawn after each change. Normally, PhEventNext is called within the Gamma next_event function, allowing events to be processed. Using PtHold prevents PhEventNext from being executed within next_event.

PtHold will not stop all Photon events from being submitted to the Photon server indefinitly. Once the application's draw buffer is full, the events will be sent to the Photon server, regardless of PtHold.

Each time PtHold is called, the global hold count increases by one. This hold count is decreased by one each time PtRelease is called. When the global hold count decreases to 0, the held Photon events are submitted to the Photon server through the event loop once again. Thus PtHold and PtRelease are typically called conjointly.

See Also

In Photon documentation: PtHold, PtRelease.