Update of /cvsroot/pywin32/pywin32/win32/Demos
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3979
Modified Files:
win32gui_menu.py
Log Message:
Show that GetMenuInfo() and GetMenuState appear to get the same incorrect
state info for some menu items
Index: win32gui_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** win32gui_menu.py 27 Nov 2008 11:11:11 -0000 1.10
--- win32gui_menu.py 4 Dec 2008 07:21:50 -0000 1.11
***************
*** 250,254 ****
rc = CheckMenuRadioItem(self.sub_menu, 1004, 1005, id,
win32con.MF_BYCOMMAND)
! # Now get the info via GetMenuItemInfo and check the new state
buf, extras = EmptyMENUITEMINFO()
win32gui.GetMenuItemInfo(self.sub_menu, id, False, buf)
--- 250,258 ----
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)
|