From: <kim...@ya...> - 2005-06-08 17:32:17
|
Okay, Alex, The simpleBrowser example works. May be it doesn't use KeyEvent? I replaced the KeyEvent code in pythoncard\event.py to the code you listed and the program doesn't crash. It's not working like one would expect, however (may be that's your purpose?) When I hit a key, say BACKSPACE, the lower text field becomes "TextArea18"... Incidentally, my KeyEvent doesn't look like the one you listed. It's doing: ## def decorate(self, aWxEvent, source): aWxEvent = Event.decorate(self, aWxEvent, source) # this is basically the same block as MouseEvent.decorate # but it seems wrong to have KeyEvent be a subclass of MouseEvent aWxEvent.position = tuple(aWxEvent.GetPosition()) aWxEvent.x = aWxEvent.GetX() aWxEvent.y = aWxEvent.GetY() aWxEvent.altDown = aWxEvent.AltDown() aWxEvent.controlDown = aWxEvent.ControlDown() aWxEvent.shiftDown = aWxEvent.ShiftDown() aWxEvent.keyCode = aWxEvent.GetKeyCode() return aWxEvent ## From the Help function of the resource editor, I get: PythonCard PythonCard is a GUI construction kit for building cross-platform desktop applications on Windows, Mac OS X, and Linux, using the Python language. PythonCard version: 0.8.1 wxPython version: 2.5.4.1 Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] Platform: win32 I will look around and see if I can find 0.8.2. Regarding the unicode version, so far the only problem I found is in the multi-column control. It was using "String" as a class type check. The proper check should have been "Strings". Thanks, -----Original Message----- Alex Tweedly wrote: > kim...@ya... wrote: > >> Alex, >> >> Your code crashed the same way on my system. As soon >> as I hit a key at the entry field, the program >> crashed. >> >> > Well, I'm pretty baffled - so I really hope someone else can chime in with an idea. > In the meantime, I'll bash on, hoping I don't ask too many stupid questions or make too many stupid suggestions. > > > Earlier, you said: > >> "Do the Pythoncard samples work OK ?" >> >> Yes. >> > Could you verify that the simpleBrowser sample works properly, including typing a URL into the URL field at the top ? > > Looking at the code involved in the traceback, I would think tuple should be safe enough - so let's see what it's being called on. > Could you change lines 335-341 of PythonCard/event.py from > >> class KeyEvent(Event): >> def decorate(self, aWxEvent, source): >> aWxEvent = Event.decorate(self, aWxEvent, source) >> # this is basically the same block as MouseEvent.decorate >> # but it seems wrong to have KeyEvent be a subclass of MouseEvent >> aWxEvent.position = tuple(aWxEvent.GetPosition()) > > > to > > class KeyEvent(Event): > def decorate(self, aWxEvent, source): > aWxEvent = Event.decorate(self, aWxEvent, source) > # this is basically the same block as MouseEvent.decorate > # but it seems wrong to have KeyEvent be a subclass of MouseEvent > mypoint = aWxEvent.GetPosition() > print mypoint > aWxEvent.position = tuple(mypoint) > > and see if that tells us anything. > If it fails one the aWxEvent.GetPosition() then let's print out the aWxEvent and see what's in it. > > btw - you said you were using latest download of PythonCard, 0.81 but latest should be 0.82 (I think). > Could you possibly run the codeEditor (or resourceEditor) and click on Help/About PythonCard.... and check what it says; my system has > > PythonCard version: 0.8.2 > wxPython version: 2.5.3.1 > Python version: 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] > Platform: win32 > > which doesn't make it clear, but it's actually wxPython wx-2.5.3-msw-ansi where you have a unicode version. > (shouldn't matter - but it's the biggest difference I've seen in our version so far) > > > Thanks, > |