From: Kevin A. <al...@se...> - 2004-04-07 21:57:14
|
Sadly, the problem was related but much more critical and we definitely have to do a 0.7.3.1 release for Linux/GTK. I have checked in a potential fix for menu.py. Rowland has checked it with 2.4.2.4 and 2.5.1.5 and we think it works. I haven't seen problems with Windows or Mac either, but I want to do more testing. Anyway, the problem is that FindMenuItem on GTK doesn't actually strip the tab and characters after the tab in a menu item label string so something like "E&xit\tAlt+x" will never get a match on GTK, so it always returns an id of -1. My menu.py code was faulty for not checking for a -1 return value from FindMenuItem. In wxPython 2.4.x you could pass an id of -1 to Enable, Check, etc. and the methods would just fail silently, but since I wasn't running GTK I never thought to check this. In 2.5.1.5 they throw an assert when you pass invalid ids like -1 which is the error Phil reported. Basically, the menu code for enabling and checking menu items has always been broken on GTK when the menu item labels contained a \t... for defining a key equivalent like Alt+X, Ctrl+C, etc. So, I've brought this up on wxPython-dev and I think I've fixed the problem in cvs, but we need to do more testing to make sure the code works correctly on all platforms with both 2.4.2.4 and 2.5.1.5 before doing a 0.7.3.1 release. There is an unrelated complication in that it appears the resourceEditor dragging and resizing code isn't working correctly with wxPython 2.5.1.5 on GTK either. More on this later. ka On Apr 7, 2004, at 11:02 AM, Kevin Altis wrote: > On Apr 7, 2004, at 10:30 AM, Kevin Altis wrote: > >> So, to verify this, simply comment out the lines menuLabel = >> m.label.strip('&') and see if the problem goes away. If that's it >> (FindMenuItem) then I'll have to do a workaround and do a 0.7.3.1 >> release. >> > Oops, that should have been, replace > > menuLabel = m.label.strip('&') > > with > > menuLabel = m.label > > The diff in cvs... > > http://cvs.sourceforge.net/viewcvs.py/pythoncard/PythonCardPrototype/ > menu.py?r1=text&tr1=1.22&r2=text&tr2=1.24&diff_format=h > > ka |