PtWindow

PtWindow — A window managed by the Photon Window Manager.

Synopsis

class PtWindow PtContainer
{
    cursor_override;          // integer  (Pt_ARG_WINDOW_CURSOR_OVERRIDE)    
    default_action;           // PtWidget 
    force_front;              // integer 
    help_root;                // string  (Pt_ARG_WINDOW_HELP_ROOT)    
    icon_window;              // PtWidget  (Pt_ARG_ICON_WINDOW)    
    managed_flags;            // flag  (Pt_ARG_WINDOW_MANAGED_FLAGS)    
    max_height;               // short  (Pt_ARG_MAX_HEIGHT)    
    max_width;                // short  (Pt_ARG_MAX_WIDTH)    
    min_height;               // short  (Pt_ARG_MIN_HEIGHT)    
    min_width;                // short  (Pt_ARG_MIN_WIDTH)    
    notify_flags;             // flag  (Pt_ARG_WINDOW_NOTIFY_FLAGS)    
    render_flags;             // flag  (Pt_ARG_WINDOW_RENDER_FLAGS)    
    state;                    // flag  (Pt_ARG_WINDOW_STATE)    
    title;                    // string  (Pt_ARG_WINDOW_TITLE)    
    title_color;              // color  (Pt_ARG_WINDOW_TITLE_COLOR)    
    window_active_color;      // color  (Pt_ARG_WINDOW_ACTIVE_COLOR)    
    window_inactive_color;    // color  (Pt_ARG_WINDOW_INACTIVE_COLOR)    
}
		

Base Classes

PtWidget <-- PtBasic <-- PtContainer <-- PtWindow

Derived Classes

PtIcon

Description

This widget is a Photon window, with a title bar, resizing buttons, and basic control menu.

[Note]

For detailed information, please refer to PtWindow in the Photon documentation.

Instance Variables

cursor_override

A number specifying whether or not the cursor of this window overrides the cursors of its children. Default, 0, means no. Any other value means yes.

default_action

This variable is not yet documented in detail.

force_front

This variable is not yet documented in detail.

help_root

A string that comprises the root path for this window's help topic. Default is "".

icon_window

A PtWidget for the icon of the window. If set to nil, the window will use a child PtIcon, otherwise a default icon.

managed_flags

This instance variable allows for Window Manager interactions, and may be a combination of zero or more of the following flags:

ConstantDescription
Ph_WM_CLOSEAllows the window manager to close the window.
Ph_WM_FOCUSAllows the window manager to handle focus on the window.
Ph_WM_MENUAllows the window to generate a 'window' menu.
Ph_WM_TOFRONTSends the window to the front.
Ph_WM_TOBACKSends the window to the back.
Ph_WM_HIDEAllows the window to be hidden.
Ph_WM_CONSWITCHMoves the window to keep it visible when the virtual console is switched.
Ph_WM_RESIZEAllows the window to be resized.
Ph_WM_MOVEAllows the window to be moved.
Ph_WM_ICONIconifies the window.
Ph_WM_MAXMaximizes the window.
Ph_WM_BACKDROPMakes the window into the backdrop.
Ph_WM_HELPAllows context-sensitive help.
Ph_WM_RESTOREDe-iconifies the window, or un-maximizes the window.
Ph_WM_FFRONTForces the window to the front.

max_height , max_width

A number of pixels that specify the maximum height or width that the window can be sized to.

min_height , min_width

A number of pixels that specify the minimum height or width that the window can be sized to. Defaults are 43 and 71 respectively.

notify_flags

Flags that allow the window to control some of its functioning locally (without help from the Window Manager). Default is Ph_WM_RESIZE | Ph_WM_CLOSE | Ph_WM_HELP.

This instance variable may be a combination of zero or more of the following flags:

ConstantDescription
Ph_WM_CLOSETells the program when a window close has been attempted.
Ph_WM_FOCUSTells the program when the window gains or loses focus.
Ph_WM_MENUTells the program when the 'window' menu has been selected.
Ph_WM_TOFRONTTells the program when the window is sent to the front.
Ph_WM_TOBACKTells the program when the window is sent to the back.
Ph_WM_HIDETells the program when the window has been hidden.
Ph_WM_CONSWITCHTells the program when the window has switched virtual consoles.
Ph_WM_RESIZETells the program when the window has been resized.
Ph_WM_MOVETells the program when the window has been moved.
Ph_WM_ICONTells the program when the window has been iconified.
Ph_WM_MAXTells the program when the window has been maximized.
Ph_WM_BACKDROPTells the program when the window has been made the backdrop.
Ph_WM_HELPTells the program when context sensitive help has been selected.
Ph_WM_RESTORETells the program when context sensitive help has been restored.
Ph_WM_FFRONTTells the program when context sensitive help has been forced to the front.

render_flags

Flags that control how the window is rendered. Default is Ph_WM_APP_DEF_RENDER, which is a combination of several of these flags.

This instance variable may be a combination of zero or more of the following flags:

ConstantDescription
Ph_WM_RENDER_ASAPPRenders the window as an application window.
Ph_WM_RENDER_ASICONRenders the window as an icon window.
Ph_WM_RENDER_ASMASKAs Mask
Ph_WM_RENDER_TITLEDraws a title bar on the window.
Ph_WM_RENDER_CLOSEDraws a close button in the window title bar.
Ph_WM_RENDER_HELPDraws a help button in the window title bar.
Ph_WM_RENDER_MAXDraws a maximize button in the window title bar.
Ph_WM_RENDER_MENUDraws a menu button in the window title bar.
Ph_WM_RENDER_MINDraws a minimize button in the window title bar.
Ph_WM_RENDER_BORDERDraws borders around the window.
Ph_WM_RENDER_RESIZEDraws resizing borders around the window.

state

This instance variable specifies the state of the window when it is first opened, and may have one of the following values:

ConstantDescription
Ph_WM_STATE_ISMASKInternal informational bit.
Ph_WM_STATE_ISHIDDENThe window opens normally, but is not displayed.
Ph_WM_STATE_ISMAXOpens the window to its maximum size.
Ph_WM_STATE_ISBACKDROPOpens the window as a workspace backdrop.
Ph_WM_STATE_ISTASKBARInternal informational bit.
Ph_WM_STATE_ISPDMInternal informational bit.
Ph_WM_STATE_ISICONIFIEDOpens the window and makes it an icon.
Ph_WM_STATE_ISICONInternal informational bit.
Ph_WM_STATE_ISFRONTOpens the window in front of all other applications.
Ph_WM_STATE_ISFOCUSOpens the window as the focus widget, if the WM cursor focus option is disabled. This is the default.

title

A string comprising the title of the window, which appears in the title bar. Default is "Untitled".

title_color

A number specifying the color of the title bar. Default is Pg_DEFAULT_WM_COLOR.

window_active_color

A number specifying the color of the frame of the window when the window has focus. Default is Pg_DEFAULT_WM_COLOR.

window_inactive_color

A number specifying the color of the frame of the window when the window doesn't have focus. Default is Pg_DEFAULT_WM_COLOR.

Callbacks

The following callbacks are associated with this widget:

CallbackDescription
Pt_CB_WINDOWThis callback is generated when an event is received from the Window Manager.
Pt_CB_WINDOW_CLOSINGThis callback is generated as the window closes, before the window region is removed.
Pt_CB_WINDOW_OPENINGThis callback is generated as the window is being opened, useful for resizing and anchoring.
Pt_CB_WINDOW_TRANSPORTThis callback is generated when a window is transported through a Jump Gate.

Convenience Functions

Arguments

widgetA PtWindow widget.

Functions

These functions are extensions of QNX Photon functions. You can refer to the PtWindow function documentation in QNX Helpviewer for more information about them.

PtWindowtoBack (widget) -- moves the window widget and all of its child windows to the back of the workspace, but not behind its parent window. To enable a child window to be moved behind its parent, make the two windows siblings by setting the child's parent to nil.

Returns t.

PtWindowtoFront (widget) -- moves the window widget and all of its child windows to the front of the workspace, and gives it focus. A parent window cannot be moved in front of its child, however. To do this, make the windows siblings by setting the child's parent to nil.

Returns t.