Re: grid_event_call in wxEuphoria
- Posted by SDPringle Mar 21, 2014
- 1287 views
mattlewis said...
SDPringle said...
procedure onClick_CellInTimeTable( atom this, atom event, atom it, atom event_type ) printf( 1, "Cell in table clicked : ", {} ) ? grid_event_cell( event ) end procedure set_event_handler( TimeTable, get_id( TimeTable ), wxEVT_GRID_CELL_LEFT_CLICK, routine_id("onClick_CellInTimeTable") )
I am trying to get the coordinates of a grid cell in an event handler in wxEuphoria. This call though only results in a crash. Anybody know how to do this?
You have the parameters for your event handler declared in the wrong order. The order should be:
- this
- event_type
- id
- event
Matt
Okay, I revised this section to be:
procedure onClick_CellInTimeTable( atom this, atom event_type, atom id, atom event ) printf( 1, "Cell in table clicked : ", {} ) ? grid_event_cell( event ) end procedure set_event_handler( TimeTable, get_id( TimeTable ), wxEVT_GRID_CELL_LEFT_CLICK, routine_id("onClick_CellInTimeTable") )
Rather than die in an ugly segmentation fault I get this now:
/usr/share/euphoria/include/wxeu/wxeud.e:12977 in function grid_event_cell() argument out of range.
I am clicking the upper left hand corner cell (0,0).