Paul McNett wrote:
> Ed Leafe wrote:
>> On Jan 22, 2009, at 2:38 PM, Paul McNett wrote:
>>
>>>>   File "/home/pmcnett/py/timetracker/ui/FrmBase.py", line 27, in
>>>> fillFileOpenMenu
>>>>     fileMenu.prependMenu(MenFileOpen(fileMenu))
>>>> AttributeError: 'NoneType' object has no attribute 'prependMenu'
>>> Here are some contextual lines from FrmBase.py:
>>>
>>>  23   def fillFileOpenMenu(self):
>>>  24     """Add the File|Open menu, with menu items for opening each
>>> form."""
>>>  25     app = self.Application
>>>  26     fileMenu = self.MenuBar.getMenu("File")
>>>  27     fileMenu.prependMenu(MenFileOpen(fileMenu))
>>
>>      Is this based on dBaseMenuBar? If so, what happens if you change line  
>> 26 to read:
>>
>> fileMenu = self.MenuBar.getMenu("base_file")
> 
> It works as expected.

However, I didn't need to change anything to get fillReportsMenu() to 
work, and it calls getMenu("Actions"), so what's the difference?

>  31   def fillReportsMenu(self):
>  32     """Add the Reports menu."""
>  33     app = self.Application
>  34     menReports = MenReports()
>  35 
>  36     # We want the reports menu right after the Actions menu:
>  37     idx = self.MenuBar.getMenuIndex("Actions")
>  38     if idx is None:
>  39       # punt:
>  40       idx = 3
>  41     idx += 1
>  42     self.MenuBar.insertMenu(idx, menReports)
>  43 
>  44     # The datanav form puts a Quick Report option at the end of the 
> Actions
>  45     # menu, but let's move it over to the Reports menu instead.
>  46     menu = self.MenuBar.getMenu("Actions")
>  47     idx = menu.getItemIndex("Quick Report")
>  48     if idx is not None:
>  49       qrItem = menu.remove(idx, False)
>  50       menReports = self.MenuBar.getMenu("Reports")
>  51       menReports.prependSeparator()
>  52       menReports.prependItem(qrItem)

Paul

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to