PtForwardWindowEvent()

Forward a window event to the window with a given region ID

Synopsis:

int PtForwardWindowEvent( 
        PhWindowEvent_t const *window_event );

Library:

ph

Description:

This function forwards the provided window event to the window manager, which forwards it to the window whose region ID is specified in the event.

Returns:

0
Success.
-1
The message couldn't be forwarded, possibly because either the Photon Manager or pwm wasn't running.

Examples:

int give_a_window_focus( PtWidget_t *widget )
{
  PhWindowEvent_t WE;

  if( !widget || !PtWidgetIsClassMember( widget, PtWindow ))
      return -1;
  memset( &WE, 0, sizeof (WE));
  WE.event_f = Ph_WM_FOCUS;
  WE.rid     = PtWidgetRid( widget );
  WE.event_state = Ph_WM_EVSTATE_FOCUS;
  return PtForwardWindowEvent( &WE );
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhWindowEvent_t, PtForwardWindowTaskEvent()

PtWindowFocus(), PtWindowToBack(), PtWindowToFront() in the Photon Widget Reference

Window Management chapter of the Photon Programmer's Guide.