Update of /cvsroot/pywin32/pywin32/win32/Demos
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29773/win32/Demos
Modified Files:
Tag: py3k
win32gui_menu.py win32gui_taskbar.py
Log Message:
merge more .py changes from the trunk (via 2to3)
Index: win32gui_taskbar.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_taskbar.py,v
retrieving revision 1.9.2.4
retrieving revision 1.9.2.5
diff -C2 -d -r1.9.2.4 -r1.9.2.5
*** win32gui_taskbar.py 4 Dec 2008 07:28:46 -0000 1.9.2.4
--- win32gui_taskbar.py 11 Dec 2008 05:45:21 -0000 1.9.2.5
***************
*** 37,41 ****
win32gui.UpdateWindow(self.hwnd)
self._DoCreateIcons()
-
def _DoCreateIcons(self):
# Try and find a custom icon
--- 37,40 ----
***************
*** 50,54 ****
if os.path.isfile(iconPathName):
icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE
! hicon = LoadImage(hinst, iconPathName, win32con.IMAGE_ICON, 0, 0, icon_flags)
else:
print("Can't find a Python icon file - using default")
--- 49,53 ----
if os.path.isfile(iconPathName):
icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE
! hicon = win32gui.LoadImage(hinst, iconPathName, win32con.IMAGE_ICON, 0, 0, icon_flags)
else:
print("Can't find a Python icon file - using default")
Index: win32gui_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v
retrieving revision 1.8.2.3
retrieving revision 1.8.2.4
diff -C2 -d -r1.8.2.3 -r1.8.2.4
*** win32gui_menu.py 4 Dec 2008 07:28:46 -0000 1.8.2.3
--- win32gui_menu.py 11 Dec 2008 05:45:21 -0000 1.8.2.4
***************
*** 250,255 ****
rc = CheckMenuRadioItem(self.sub_menu, 1004, 1005, id,
win32con.MF_BYCOMMAND)
new_state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND)
! if new_state & win32con.MF_CHECKED != check_flags:
raise RuntimeError("The new item didn't get the new checked state!")
else:
--- 250,264 ----
rc = CheckMenuRadioItem(self.sub_menu, 1004, 1005, id,
win32con.MF_BYCOMMAND)
+ # Get and check the new state - first the simple way...
new_state = GetMenuState(self.sub_menu, id, win32con.MF_BYCOMMAND)
! if new_state & win32con.MF_CHECKED != check_flags:
! raise RuntimeError("The new item didn't get the new checked state!")
! # Now the long-winded way via GetMenuItemInfo...
! buf, extras = EmptyMENUITEMINFO()
! win32gui.GetMenuItemInfo(self.sub_menu, id, False, buf)
! fType, fState, wID, hSubMenu, hbmpChecked, hbmpUnchecked, \
! dwItemData, text, hbmpItem = UnpackMENUITEMINFO(buf)
!
! if fState & win32con.MF_CHECKED != check_flags:
raise RuntimeError("The new item didn't get the new checked state!")
else:
|