On Tue, Jul 12, 2016 at 8:37 AM, 'Terry Brown' via leo-editor < [email protected]> wrote:
Ah, excellent, thanks, would have been a shame to implement it without > noticing that :-) And there's no delay in this event firing the way > there is with tool tips, so it works much better for browsing menu > functionality. > An excellent collaboration so far. So now we just need to identify a source of useful tips. I think the > @menu tree could carry them, or they could come from the doc. string of > the function the menu fires. Don't want repeated descriptions in two > different places, but suspect the appropriate one liners might be > easier to collect in the @menu tree. > There are some issues to be dealt with. For sure, the statusTips should be a single line. They should probably be created in the same place that creates the actual menu items, namely createMenuEntries (in leoMenu.py) and its helpers. The question is, what should the text be, and where to get it? Defining text in the @menu tree would duplicate some of the text of help-for-command (F11). The text in the @menu tree would easily get out of sync with the F11 text. So I *think* my preference is to have all command docstrings start with a single line that will become the statusTips text for the menu item corresponding to the command . The only question is whether the docstring ca n be obtained quickly enough. I think it can. It would be straightforward to write a script to print the docstrings for all functions/methods with @cmd or @g.command decorators. Actually, a similar script already exists in scripts.leo: @file leoScripts.txt-->Docstrings-->Print commands & docstrings This would be a starting point for startup code that would discover all statusTips. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
