From: Kevin A. <al...@se...> - 2006-05-26 01:15:19
|
On May 25, 2006, at 4:11 PM, Alex Tweedly wrote: > > Some time ago a problem was reported with walkthrough1 and the > attached source file starter1.py, which I fixed. > > I didn't realize there were two more problems (just realized when > someone updated the SF bug report). > > Firstly, the example starts out using the "About" menu selection > and later switches to talking about the "Exit" menu selection (I > believe the code used to use on_menuFileExit_select, and now uses > on_menuFileAbout_select. > > Secondly, the resource file is set up for the more recent > convention with menus - using > 'command': 'about, > and therefore needs the code changed to use on_about_command. (or > the command option needs to be removed from the rsrc file). > > I'm inclined to think the right thing to do is to change to use > "on_about_command", since that is the convention used by the > current menuBuilder. I would probably rename it to > on_editFileAbout_command. > > Suggestions ? There is no real need to use a command unless you want the same event handler to deal with multiple menu items or more commonly a menu item and button. I think what happened with this file and resource is that I changed all the samples and tools to just use a command for the File->Exit menu and made the handler part of the main Background class and since I was doing global changes this slipped through the cracks. So for the most part File->Exit is always taken care of and it can be ignored. We need to have some kind of event handler in the starter1.py file so having an about item or something like that makes sense. ka |