![]() |
![]() |
![]() |
![]() |
Layout and geometry management for all container widgets
PtWidget --> PtBasic --> PtContainer
Immediate subclasses:
For more information, see the diagram of the widget hierarchy.
None -- not normally instantiated.
<photon/PtContainer.h>
The PtContainer superclass provides layout and geometry management for all container widgets. It also redirects certain events -- such as button presses, releases, repeats, and keys -- to the child that has focus.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_CONTAINER_FLAGS | long | Flag | Pt_ENABLE_CUA |
Pt_ARG_CURSOR_OVERRIDE | int | Boolean | Pt_FALSE |
Pt_ARG_TITLE | char * | String | NULL |
Pt_ARG_TITLE_FONT | char * | String | "TextFont09" |
Pt_CB_BALLOONS | PtBalloonCallback_t * | Link | NULL |
Pt_CB_CHILD_ADDED_REMOVED | PtCallback_t * | Link | NULL |
Pt_CB_RESIZE | PtCallback_t * | Link | NULL |
C type | Pt type | Default |
---|---|---|
long | Flag | Pt_ENABLE_CUA |
Flags that control the look and behavior of the container:
C type | Pt type | Default |
---|---|---|
int | Boolean | Pt_FALSE |
Let the container's cursor override its children's cursors.
C type | Pt type | Default |
---|---|---|
char * | String | NULL |
The title to be displayed if Pt_SHOW_TITLE is set in Pt_ARG_CONTAINER_FLAGS.
C type | Pt type | Default |
---|---|---|
char * | String | "TextFont09" |
The font to use for the label's text string; see PgSetFont() in the Photon Library Reference.
C type | Pt type | Default |
---|---|---|
PtBalloonCallback_t * | Link | NULL |
A list of PtBalloonCallback_t structures that define balloon callbacks that the container invokes if the pointer remains motionless for 1.25 seconds over the widget specified in the callback structure.
Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
![]() |
These callbacks (unlike other callbacks) return nothing. |
By default, this callback list invokes the indicated widget's inflate function, which is specified by the following resources:
When a container has balloons registered, it becomes sensitive to Ph_EV_BOUNDARY events. When the container sees an enter event, it enables the balloon mechanism for that container. When a boundary event with a subtype of Ph_EV_PTR_STEADY is received and it's over a widget that has registered a balloon, the balloons are flagged as active and the widget's inflate function is called.
While the balloons are active, Ph_EV_PTR_MOTION_NOBUTTON events are used to determine when the cursor leaves a widget with an inflated balloon (its inflate function is called with a Pt_POP_BALLOON subtype). While the balloons are active, any widget that has a balloon that intersects with a Ph_EV_PTR_MOTION_NOBUTTON event has its balloon inflated.
Key events and pointer button events deactivate the balloons. Another Ph_EV_PTR_STEADY event over a widget with a balloon is required to reactivate the balloons.
![]() |
If your application has a widget that obscures the container, the
widget must have a region that consumes Ph_EV_BOUNDARY
events to prevent the balloon mechanism for the container
from becoming enabled and activated.
This can be done by giving the overlapping widget a Pt_CB_RAW callback (see PtWidget) that's sensitive to Ph_EV_BOUNDARY events, or by giving the overlapping widget a cursor (which automatically sets Ph_FORCE_BOUNDARY in the flags for the widget's region, which means it's opaque to boundary events). |
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of PtCallback_t structures that define the callbacks that are invoked when a widget is added or removed from a container:
![]() |
These callbacks are invoked only if:
|
Each callback is passed a PtCallbackInfo_t structure that contains at least the following:
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of PtCallback_t structures that define the callbacks that the container invokes when its size changes. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
These callbacks should return Pt_CONTINUE.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
![]() |
![]() |
![]() |
![]() |