GraphicsWindow

from panda3d.core import GraphicsWindow
class GraphicsWindow

Bases: GraphicsOutput

A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display.

Inheritance diagram

Inheritance diagram of GraphicsWindow

__init__(*args, **kwargs)
clearRejectedProperties()

C++ Interface: clear_rejected_properties(const GraphicsWindow self)

/**
  • Empties the set of failed properties that will be returned by

  • get_rejected_properties().

*/

clear_rejected_properties()

C++ Interface: clear_rejected_properties(const GraphicsWindow self)

/**
  • Empties the set of failed properties that will be returned by

  • get_rejected_properties().

*/

closeIme()

C++ Interface: close_ime(const GraphicsWindow self)

/**
  • Forces the ime window to close if any

*/

close_ime()

C++ Interface: close_ime(const GraphicsWindow self)

/**
  • Forces the ime window to close if any

*/

close_request_event
closed
disablePointerEvents()

C++ Interface: disable_pointer_events(const GraphicsWindow self, int device)

/**
  • Turn off the generation of pointer events.

*/

disable_pointer_events()

C++ Interface: disable_pointer_events(const GraphicsWindow self, int device)

/**
  • Turn off the generation of pointer events.

*/

enablePointerEvents()

C++ Interface: enable_pointer_events(const GraphicsWindow self, int device)

/**
  • Turn on the generation of pointer events.

*/

enable_pointer_events()

C++ Interface: enable_pointer_events(const GraphicsWindow self, int device)

/**
  • Turn on the generation of pointer events.

*/

getClassType()

C++ Interface: get_class_type()

getCloseRequestEvent()

C++ Interface: get_close_request_event(GraphicsWindow self)

/**
  • Returns the name of the event set via set_close_request_event(). If this

  • string is nonempty, then when the user requests to close window, this event

  • will be generated instead. See set_close_request_event().

*/

getInputDevice()

C++ Interface: get_input_device(GraphicsWindow self, int i)

/**
  • Returns the nth input device associated with the window. Typically, a

  • window will have exactly one input device: the keyboard/mouse pair.

*/

getInputDeviceName()

C++ Interface: get_input_device_name(GraphicsWindow self, int device)

/**
  • Returns the name of the nth input device.

*/

getInputDeviceNames()
getInputDevices()
getKeyboardMap()

C++ Interface: get_keyboard_map(GraphicsWindow self)

/**
  • Returns a ButtonMap containing the association between raw buttons and

  • virtual buttons.

*/

getNumInputDevices()

C++ Interface: get_num_input_devices(GraphicsWindow self)

// Mouse and keyboard routines

// Mouse and keyboard routines

// Mouse and keyboard routines

/**
  • Returns the number of separate input devices associated with the window.

  • Typically, a window will have exactly one input device: the keyboard/mouse

  • pair. However, some windows may have no input devices, and others may add

  • additional devices, for instance for a joystick.

*/

getPointer()

C++ Interface: get_pointer(GraphicsWindow self, int device)

/**
  • Returns the PointerData associated with the nth input device’s pointer.

  • Using this to access raw mice (with an index other than 0) is deprecated,

  • see the InputDeviceManager interface instead.

*/

getProperties()

C++ Interface: get_properties(GraphicsWindow self)

/**
  • Returns the current properties of the window.

*/

getRejectedProperties()

C++ Interface: get_rejected_properties(GraphicsWindow self)

/**
  • Returns the set of properties that have recently been requested, but could

  • not be applied to the window for some reason. This set of properties will

  • remain unchanged until they are changed by a new failed request, or

  • clear_rejected_properties() is called.

*/

getRequestedProperties()

C++ Interface: get_requested_properties(GraphicsWindow self)

/**
  • Returns the properties of the window that are currently requested. These

  • properties will be applied to the window (if valid) at the next execution

  • of process_events().

*/

getUnexposedDraw()

C++ Interface: get_unexposed_draw(GraphicsWindow self)

/**
  • See set_unexposed_draw().

*/

getWindowEvent()

C++ Interface: get_window_event(GraphicsWindow self)

/**
  • Returns the name of the event that is generated when this window is

  • modified externally, e.g. to be resized or closed by the user. See

  • set_window_event().

*/

getWindowHandle()

C++ Interface: get_window_handle(GraphicsWindow self)

/**
  • Returns the WindowHandle corresponding to this window on the desktop. This

  • is mainly useful for communicating with external libraries. Use

  • window_handle->get_os_handle()->get_handle(), or

  • window_handle->get_string_handle(), to get the actual OS-specific window

  • handle object, whatever type that might be.

*/

get_class_type()

C++ Interface: get_class_type()

get_close_request_event()

C++ Interface: get_close_request_event(GraphicsWindow self)

/**
  • Returns the name of the event set via set_close_request_event(). If this

  • string is nonempty, then when the user requests to close window, this event

  • will be generated instead. See set_close_request_event().

*/

get_input_device()

C++ Interface: get_input_device(GraphicsWindow self, int i)

/**
  • Returns the nth input device associated with the window. Typically, a

  • window will have exactly one input device: the keyboard/mouse pair.

*/

get_input_device_name()

C++ Interface: get_input_device_name(GraphicsWindow self, int device)

/**
  • Returns the name of the nth input device.

*/

get_input_device_names()
get_input_devices()
get_keyboard_map()

C++ Interface: get_keyboard_map(GraphicsWindow self)

/**
  • Returns a ButtonMap containing the association between raw buttons and

  • virtual buttons.

*/

get_num_input_devices()

C++ Interface: get_num_input_devices(GraphicsWindow self)

// Mouse and keyboard routines

// Mouse and keyboard routines

// Mouse and keyboard routines

/**
  • Returns the number of separate input devices associated with the window.

  • Typically, a window will have exactly one input device: the keyboard/mouse

  • pair. However, some windows may have no input devices, and others may add

  • additional devices, for instance for a joystick.

*/

get_pointer()

C++ Interface: get_pointer(GraphicsWindow self, int device)

/**
  • Returns the PointerData associated with the nth input device’s pointer.

  • Using this to access raw mice (with an index other than 0) is deprecated,

  • see the InputDeviceManager interface instead.

*/

get_properties()

C++ Interface: get_properties(GraphicsWindow self)

/**
  • Returns the current properties of the window.

*/

get_rejected_properties()

C++ Interface: get_rejected_properties(GraphicsWindow self)

/**
  • Returns the set of properties that have recently been requested, but could

  • not be applied to the window for some reason. This set of properties will

  • remain unchanged until they are changed by a new failed request, or

  • clear_rejected_properties() is called.

*/

get_requested_properties()

C++ Interface: get_requested_properties(GraphicsWindow self)

/**
  • Returns the properties of the window that are currently requested. These

  • properties will be applied to the window (if valid) at the next execution

  • of process_events().

*/

get_unexposed_draw()

C++ Interface: get_unexposed_draw(GraphicsWindow self)

/**
  • See set_unexposed_draw().

*/

get_window_event()

C++ Interface: get_window_event(GraphicsWindow self)

/**
  • Returns the name of the event that is generated when this window is

  • modified externally, e.g. to be resized or closed by the user. See

  • set_window_event().

*/

get_window_handle()

C++ Interface: get_window_handle(GraphicsWindow self)

/**
  • Returns the WindowHandle corresponding to this window on the desktop. This

  • is mainly useful for communicating with external libraries. Use

  • window_handle->get_os_handle()->get_handle(), or

  • window_handle->get_string_handle(), to get the actual OS-specific window

  • handle object, whatever type that might be.

*/

hasKeyboard()

C++ Interface: has_keyboard(GraphicsWindow self, int device)

/**
  • Returns true if the nth input device has a keyboard, false otherwise.

*/

hasPointer()

C++ Interface: has_pointer(GraphicsWindow self, int device)

/**
  • Returns true if the nth input device has a screen-space pointer (for

  • instance, a mouse), false otherwise.

*/

has_keyboard()

C++ Interface: has_keyboard(GraphicsWindow self, int device)

/**
  • Returns true if the nth input device has a keyboard, false otherwise.

*/

has_pointer()

C++ Interface: has_pointer(GraphicsWindow self, int device)

/**
  • Returns true if the nth input device has a screen-space pointer (for

  • instance, a mouse), false otherwise.

*/

isClosed()

C++ Interface: is_closed(GraphicsWindow self)

/**
  • Returns true if the window has not yet been opened, or has been fully

  • closed, false if it is open. The window is not opened immediately after

  • GraphicsEngine::make_output() is called; nor is it closed immediately after

  • GraphicsEngine::remove_window() is called. Either operation may take a

  • frame or two.

*/

isFullscreen()

C++ Interface: is_fullscreen(GraphicsWindow self)

/**
  • Returns true if the window has been opened as a fullscreen window, false

  • otherwise.

*/

is_closed()

C++ Interface: is_closed(GraphicsWindow self)

/**
  • Returns true if the window has not yet been opened, or has been fully

  • closed, false if it is open. The window is not opened immediately after

  • GraphicsEngine::make_output() is called; nor is it closed immediately after

  • GraphicsEngine::remove_window() is called. Either operation may take a

  • frame or two.

*/

is_fullscreen()

C++ Interface: is_fullscreen(GraphicsWindow self)

/**
  • Returns true if the window has been opened as a fullscreen window, false

  • otherwise.

*/

movePointer()

C++ Interface: move_pointer(const GraphicsWindow self, int device, int x, int y)

/**
  • Forces the pointer to the indicated position within the window, if

  • possible.

  • Returns true if successful, false on failure. This may fail if the mouse

  • is not currently within the window, or if the API doesn’t support this

  • operation.

*/

move_pointer()

C++ Interface: move_pointer(const GraphicsWindow self, int device, int x, int y)

/**
  • Forces the pointer to the indicated position within the window, if

  • possible.

  • Returns true if successful, false on failure. This may fail if the mouse

  • is not currently within the window, or if the API doesn’t support this

  • operation.

*/

properties
rejected_properties
requestProperties()

Requests a property change on the window. For example, use this method to request a window change size or minimize or something.

The change is not made immediately; rather, the request is saved and will be applied the next time the window task is run (probably at the next frame).

request_properties()

Requests a property change on the window. For example, use this method to request a window change size or minimize or something.

The change is not made immediately; rather, the request is saved and will be applied the next time the window task is run (probably at the next frame).

requested_properties
setCloseRequestEvent()

C++ Interface: set_close_request_event(const GraphicsWindow self, str close_request_event)

/**
  • Sets the event that is triggered when the user requests to close the

  • window, e.g. via alt-F4, or clicking on the close box.

  • The default for each window is for this event to be the empty string, which

  • means the window-close request is handled immediately by Panda (and the

  • window will be closed without the app getting a chance to intervene). If

  • you set this to a nonempty string, then the window is not closed, but

  • instead the event is thrown. It is then up to the app to respond

  • appropriately, for instance by presenting an “are you sure?” dialog box,

  • and eventually calling close_window() when the user is sure.

  • It is considered poor form to set this string and then not handle the

  • event. This can frustrate the user by making it difficult for him to

  • cleanly shut down the application (and may force the user to hard-kill the

  • app, or reboot the machine).

*/

setUnexposedDraw()

C++ Interface: set_unexposed_draw(const GraphicsWindow self, bool unexposed_draw)

/**
  • If this flag is false, the window is redrawn only after it has received a

  • recent “unexpose” or “draw” event from the underlying windowing system. If

  • this flag is true, the window is redrawn every frame regardless. Setting

  • this false may prevent the window from redrawing unnecessarily when it is

  • hidden, and may play nicer with other windows on the desktop, but may

  • adversely affect frame rate even when the window is fully visible; setting

  • it true will ensure that the window contents are always current.

*/

setWindowEvent()

C++ Interface: set_window_event(const GraphicsWindow self, str window_event)

/**
  • Changes the name of the event that is generated when this window is

  • modified externally, e.g. to be resized or closed by the user.

  • By default, all windows have the same window event unless they are

  • explicitly changed. When the event is generated, it includes one

  • parameter: the window itself.

*/

set_close_request_event()

C++ Interface: set_close_request_event(const GraphicsWindow self, str close_request_event)

/**
  • Sets the event that is triggered when the user requests to close the

  • window, e.g. via alt-F4, or clicking on the close box.

  • The default for each window is for this event to be the empty string, which

  • means the window-close request is handled immediately by Panda (and the

  • window will be closed without the app getting a chance to intervene). If

  • you set this to a nonempty string, then the window is not closed, but

  • instead the event is thrown. It is then up to the app to respond

  • appropriately, for instance by presenting an “are you sure?” dialog box,

  • and eventually calling close_window() when the user is sure.

  • It is considered poor form to set this string and then not handle the

  • event. This can frustrate the user by making it difficult for him to

  • cleanly shut down the application (and may force the user to hard-kill the

  • app, or reboot the machine).

*/

set_unexposed_draw()

C++ Interface: set_unexposed_draw(const GraphicsWindow self, bool unexposed_draw)

/**
  • If this flag is false, the window is redrawn only after it has received a

  • recent “unexpose” or “draw” event from the underlying windowing system. If

  • this flag is true, the window is redrawn every frame regardless. Setting

  • this false may prevent the window from redrawing unnecessarily when it is

  • hidden, and may play nicer with other windows on the desktop, but may

  • adversely affect frame rate even when the window is fully visible; setting

  • it true will ensure that the window contents are always current.

*/

set_window_event()

C++ Interface: set_window_event(const GraphicsWindow self, str window_event)

/**
  • Changes the name of the event that is generated when this window is

  • modified externally, e.g. to be resized or closed by the user.

  • By default, all windows have the same window event unless they are

  • explicitly changed. When the event is generated, it includes one

  • parameter: the window itself.

*/

unexposed_draw
window_event
window_handle