Give an event to a widget
int PtSendEventToWidget( PtWidget_t *widget, PhEvent_t *event );
This function allows an event to be given directly to any widget for processing.
// 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); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |