Update of /cvsroot/pywin32/pywin32/win32/Demos
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29057/win32/Demos
Modified Files:
win32gui_menu.py
Log Message:
Add demo for GetMenuItemInfo
Index: win32gui_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** win32gui_menu.py 30 Oct 2007 09:27:13 -0000 1.6
--- win32gui_menu.py 30 Jun 2008 12:58:02 -0000 1.7
***************
*** 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,260 ----
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)
! 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:
|