From: <a_r...@ya...> - 2007-09-07 18:02:56
|
Hi, Is there another function apart form propagateEvent to send events to the "standard" event handler? For example in these situations: 1) I have some TexEntry widgets on a frame. If the user press Tab, focus moves to next TexEntry. Now, I want to handle that event this way: if user press Tab, the program does something (for example, check if the text entered is a number) and then pass the event to the "standard" handler to move the focus to the next widget. I could change the focus by hand, but this is cumbersome, I don't want to manage a list of widgets, use a Var to store where focus is, etc., this is wxhaskell's job. 2) I need to autocomplete text on a TextEntry. So, if I use "on keyboard" to detect when user types next letter, and thus I can do something with that letter, the "standard" event handler doesn't see the event, and thus the letter is not printed on the TextEntry. I have to do something like "set text :~ (++ <letter>)". The problem is that these events only detect keypresses, not text. If user press "A" I only see a "shift key press" followed by "a key press". I have to translate key press sequences to text, which is a pain for languages with accented characters, and impossible if user press Ctrl-v and pastes some text. If I could do something like: on keyboard ::= \w -> standardHandler >> get w text >>= myFunction this problem dissapears. Is there a way to do this, or something with the same result? Antonio Regidor Garcia ____________________________________________________________________________________ Sé un Mejor Amante del Cine ¿Quieres saber cómo? ¡Deja que otras personas te ayuden! http://advision.webevents.yahoo.com/reto/entretenimiento.html |