1. grid_event_call in wxEuphoria
- Posted by SDPringle Mar 21, 2014
- 1301 views
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?
2. Re: grid_event_call in wxEuphoria
- Posted by mattlewis (admin) Mar 21, 2014
- 1305 views
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
3. Re: grid_event_call in wxEuphoria
- Posted by SDPringle Mar 21, 2014
- 1288 views
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).
4. Re: grid_event_call in wxEuphoria
- Posted by mattlewis (admin) Mar 21, 2014
- 1248 views
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).
The following works for me:
include wxeu/wxeud.e constant main = create( wxFrame, { 0, -1, "Grid Test" } ), grid = create( wxGrid, { main } ) 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( grid, get_id( grid ), wxEVT_GRID_CELL_LEFT_CLICK, routine_id("onClick_CellInTimeTable") ) wxMain( main )
...although I'm running wxWidgets 2.9 (and wxEuphoria from the 2.9 branch).
Matt
5. Re: grid_event_call in wxEuphoria
- Posted by SDPringle Mar 21, 2014
- 1245 views
Okay Matt, I'll look forward to your 3.0.0 release.