[Haskell-cafe] WxHaskell Question: How to get mouse or context menu events for wxGrid

Jason Dagit dagit at eecs.oregonstate.edu
Fri Jul 7 14:43:46 EDT 2006


Not sure where to ask this question but maybe here is a good place.

I'm trying to use wxHaskell and I need a table with a right-click
context menu.  So far it seems that I can get some events on a wxGrid
but not the context menu event or the mouse right click event.

To get grid events I've followed the example in the wxHaskell source
which grabs grid events.  Using this technique I can get mouse
right-clicks if they happen in a cell.  I was hoping to get the events
when the click happens in the wxGrid control but not over a cell (for
example, you might click below the last row and the menu would have an
option to create a new row).

I tried the following but the events never seem to fire:
windowOnMouse myGrid True (_ -> logMessage "mouse event" >> propagateEvent)
windowOnContextMenu myGrid (logMessage "context menu")

I have logMessage set to use stderr for output and I know it works great.

Any ideas on how to do this?


More information about the Haskell-Cafe mailing list