Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsendeventtowidget.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsendeventtowidget.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsendeventtowidget.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsendeventtowidget.html on line 8

PtSendEventToWidget()

Give an event to a widget

Synopsis:

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

Library:

ph

Description:

This function passes the event in the given PhEvent_t structure directly to the given widget for processing.


Note: The widget expects the event to be followed immediately by the associated set of rectangles and event data. See the example below.

Returns:

The value returned by the last callback function invoked by the event, or -1 if 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:

PhEvent_t, PhEmit(), PhEmitmx(), PhPointerEvent_t

Events chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsendeventtowidget.html on line 140

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsendeventtowidget.html on line 140