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

PtSendEventToWidget()

Give an event to a widget

Synopsis:

int PtSendEventToWidget( PtWidget_t *widget, 
                         PhEvent_t *event );

Description:

This function allows an event to be given directly to any widget for processing.

Returns:

0
Successful completion.
-1
An error occurred.

Examples:

// Send a Phantom release event to a widget.

Phantom( PtWidget_t *widget, PhEvent_t *event )
{
  struct{
    PhEvent_t event;
    PhRect_t  rect;
    PhPointerEvent_t pevent;
  } new_event;

  memset( &new_event.rect, -1 , 
          sizeof( new_event.rect ) );

  if( event ) {
    new_event.event = *event;
  }

  new_event.event.processing_flags = Ph_FAKE_EVENT;
  new_event.event.type = Ph_EV_BUT_RELEASE;
  new_event.event.subtype = Ph_EV_RELEASE_PHANTOM;;
  new_event.pevent.click_count = 1;
  new_event.pevent.buttons = Ph_BUTTON_SELECT;
  new_event.event.num_rects = 1;
  PtSendEventToWidget( widget, 
                       (PhEvent_t *) &new_event);
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhEventEmit()


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