shelarcy wrote: > Hi Andrew, > > I'm sorry about my reply is late. > Do you already solve this problem? > > On Thu, 08 Nov 2007 18:23:40 +0900, Andrew Butterfield <[EMAIL PROTECTED]> > wrote: > >> My code - for the relevant windows >> >> > -- Goal Window >> > gp <- panel h [] >> > g <- scrolledWindow gp [] >> >> Do I need to nest another window inside the scrolled window ? >> When I perform the right-arrow action (say), I repaint g, >> which renders the expression appropriately. >> > > Is gp a panel? > > I don't know why you don't want to set key events for panel > instead of scrolledWindow. I think you can skip key events > for scrolledWindow by propagateEvent, if you set key events > for panel. > OK - I see what you mean - I thought that as I had to paint to g that I needed to catch keystrokes there - but of course these are independent of the painting - so I see what you are suggesting.
I solved the problem in a different way - I started experimenting in another window and discovered the following. If, in g (above) I handle arrow keys with individual handler like so: set g [ on downKey := .... ; on upKey := ... ... ] then hitting the down-arrow keys triggers my handler and that for the scrollbars. However if I set a single handler for all keys which then does a case analysis of keys, as follows:, then the scroll bars are not affected by the arrow keys. set g [ on anyKey := handleKeys ... ] handleKeys ... k = case k of KeyDown -> .... KeyUp -> ... -- -------------------------------------------------------------------- Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204 Foundations and Methods Research Group Director. Course Director, B.A. (Mod.) in CS and ICT degrees, Year 4. Department of Computer Science, Room F.13, O'Reilly Institute, Trinity College, University of Dublin, Ireland. http://www.cs.tcd.ie/Andrew.Butterfield/ -------------------------------------------------------------------- ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users