[Pythonmac-SIG] Patch to IDLE
Ronald Oussoren
ronaldoussoren at mac.com
Tue May 19 19:06:34 CEST 2009
On 19 May, 2009, at 17:14, Kevin Walzer wrote:
> Ronald Oussoren wrote:
>
>> I would have thought that overrideRootMenu is the right location
>> for your change, that function should be called (by setupApp in the
>> same function) by the time everything is set up (PyShell calls
>> setApp just before opening the console window).
>> The IDLE codebase can be annoyingly hard to understand at times,
>> which makes creating patches unnecesserily hard at times.
>> I'm afraid the only way to find the correct location for a patch is
>> by trial and error, first try to hardcode a fix inline and when
>> that works move the code to a function in macosxSupport.py.
>
> Ronald,
>
> You are right, the codebase is complex.
>
> Setting aside the application/apple menu for the moment, I've run
> into another issue. With Tk-Cocoa, the "help" menu automagically
> adds a menu entry for an Apple help book, and pops up a dialog
> saying "Help isn't available for Foo.app." I think PyObjC does
> something similar; it's the default behavior for the help menu in
> Cocoa. However, if the app defines its own help command (as IDLE
> does), then you have two "help" commands under the help menu--the
> useless Cocoa command and the IDLE-defined one.
>
> The workaround is to rename the "help" menu to something else, i.e.
> "helpdocs"; this avoids the empty Cocoa help command. I've tried
> this at various points in the IDLE code (Bindings.py,
> EditorWindow.py), and it seems to work. However, I'm not sure if
> doing this would break IDLE on other platforms.
>
> Simply re-naming the "help" menu to something else is preferable and
> simpler to wrapping the menu_specs dict in a lot of platform-
> specific logic: I've tried adding some "if
> macosxSupport.runningAsOSXApp():" lines to the code, but that
> crashes IDLE at various points. Any advice here?
File bugs with the Tk-Cocoa developers. I'd consider both the
addition of an unwanted help menu and the, yet again, changed way to
surpress the default application menu bugs in Tk. We could continue
to add more and more workarounds to IDLE, but it might be early enough
to get this fixed in Tk itself.
Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2224 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20090519/a2841ec2/attachment.bin>
More information about the Pythonmac-SIG
mailing list