Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19393/pywin/framework
Modified Files:
intpyapp.py
Log Message:
Hopefully a final fix for "[ 944506 ] PythonWin Menus don't work" and many
other bugs relating to the registry filling up with toolbar registry
entries.
The problem was the fact that the debugging package dynamically created
docable toolbars. When pythonwin started for the first time, references to
these debugging toolbars caused MFC to get upset, and left the "stale"
entries for those toolbars in the list. Later, when a debugging session
started, these toolbars again got new entries which were written to the
registry along with the old ones. Next startup, the cycle started again
(but this time creating even more new ones, ignoring even more stale ones)
Also incorporates [ 1101347 ] Docking toolbar AV at shut down from
Greg Chapman, which was also reflected in other bugs relating to the
task-bar icon remaining and the MRU menus not updating in Python 2.4.
Index: intpyapp.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** intpyapp.py 9 Apr 2004 11:31:57 -0000 1.8
--- intpyapp.py 5 Mar 2005 03:24:13 -0000 1.9
***************
*** 29,41 ****
tb.EnableDocking(afxres.CBRS_ALIGN_ANY)
tb.SetWindowText("Standard")
-
- tbd = win32ui.CreateToolBar (self, style, win32ui.ID_VIEW_TOOLBAR_DBG)
- tbd.ModifyStyle(0, commctrl.TBSTYLE_FLAT)
- tbd.LoadToolBar(win32ui.IDR_DEBUGGER)
- tbd.EnableDocking(afxres.CBRS_ALIGN_ANY)
- tbd.SetWindowText("Debugger")
-
self.DockControlBar(tb)
! self.DockControlBar(tbd)
# And a "Tools" menu on the main frame.
menu = self.GetMenu()
--- 29,38 ----
tb.EnableDocking(afxres.CBRS_ALIGN_ANY)
tb.SetWindowText("Standard")
self.DockControlBar(tb)
! # Any other packages which use toolbars
! from pywin.debugger.debugger import PrepareControlBars
! PrepareControlBars(self)
! # Note "interact" also uses dockable windows, but they already happen
!
# And a "Tools" menu on the main frame.
menu = self.GetMenu()
***************
*** 64,69 ****
--- 61,77 ----
from pywin.framework import help
help.FinalizeHelp()
+
+ self.DestroyControlBar(afxres.AFX_IDW_TOOLBAR)
+ self.DestroyControlBar(win32ui.ID_VIEW_TOOLBAR_DBG)
return self._obj_.OnClose()
+
+ def DestroyControlBar(self, id):
+ try:
+ bar = self.GetControlBar(id)
+ except win32ui.error:
+ return
+ bar.DestroyWindow()
+
def OnCommand(self, wparam, lparam):
# By default, the current MDI child frame will process WM_COMMAND
|