From: Andy T. <an...@cr...> - 2001-09-04 02:02:47
|
Kevin Altis wrote: >>From: Andy Todd >> >>Perusing spec.py I noticed a small typo. The event name 'keyUp' was >>incorrectly entered as 'keUp' in the events list for 'widget'. This >>would stop any key up event handlers from working in current and >>previous releases. This has now been fixed and updated in cvs and should >>be included in the next release. >> >>There, we can all breathe a sigh of relief now ;-) >> >>Whilst I was looking at the event model I wondered if anyone has felt >>the need to write a key down or key up event handler? I can't recall >>ever doing so, key press is sufficient for most of my requirements. Just >>because we can support key down and up (and indeed mouse down and mouse >>up) do we actually need these events in PythonCard? In the spirit of >>KISS maybe we could leave them out. Or not, I'm just thinking out loud >>here so feel free to join in if you have an opinion. >> > > Events that you can ignore don't really make the system more complex. You > can typically ignore mouseDown and mouseUp and just use mouseClick, but when > you need them, they are really nice (see resourceEditor.py). Just goes to prove that just because I don't use it doesn't mean that it isn't useful. Thanks for that Kevin, and now that I actually wind my brain into gear I can help but think this will be useful. > > If you look at > > class wxPython_TextFieldEventBinding > > in wxPython_binding, you'll see that the only events bound right now are > 'textUpdate' and 'textEnter'. I had written the code to do the other text > events but it was before we got cvs going and while Rowland and I were > emailing files back and forth the code got dropped. There may also have been > some issues with calling Event.Skip() in wxPython, but I can't remember. > Anyway, I need to get back into the event binding code, add the missing > events, add closeField and/or exitField like I planned to a long time ago > (well six weeks seems like a long time) and then verify that everything > works as planned. I'll try and do that this week. > > ka > I guess our initial approach should be to cope with all of the events specified by wxPython and then review what is and isn't required later. I really should get round to reading the documentation then I may be able to comment intelligently. In the medium(ish) term I can see the need to add events to PythonCard specific objects (like the ability to map mouse click to a background as show in tictactoe.py) and perhaps we should lend some thought to what is useful and practicable here as well. Of course, this will be brought into focus when (if?) we implement multiple cards on a background and/or multiple windows as we will then need to cope with a whole heap of navigation events. Regards, Andy -- ----------------------------------------------------------------------- From the desk of Andrew J Todd esq. "Shave my poodle!" |