1. grid_event_call in wxEuphoria

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?

new topic     » topic index » view message » categorize

2. Re: grid_event_call in wxEuphoria

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: grid_event_call in wxEuphoria

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).

new topic     » goto parent     » topic index » view message » categorize

4. Re: grid_event_call in wxEuphoria

SDPringle said...

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: grid_event_call in wxEuphoria

Okay Matt, I'll look forward to your 3.0.0 release.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu