[Previous] [Contents] [Index] [Next]

PtForwardWindowEvent()

Forward a window event

Synopsis:

int PtForwardWindowEvent( 
        PhWindowEvent_t const *window_event );

Description:

This function forwards the provided window event to the window manager.

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.


[Previous] [Contents] [Index] [Next]