Menu Methods @pymethod |PyCMenu|AppendMenu|Appends a new item to the end of a menu. Python can specify the state of the menu item by setting values in nFlags.
| 94 | // Menu Methods |
| 95 | // @pymethod |PyCMenu|AppendMenu|Appends a new item to the end of a menu. Python can specify the state of the menu item by setting values in nFlags. |
| 96 | PyObject *PyCMenu::AppendMenu(PyObject *self, PyObject *args) |
| 97 | { |
| 98 | HMENU hMenu = GetMenu( self ); |
| 99 | if (!hMenu) |
| 100 | return NULL; |
| 101 | TCHAR *value = NULL; |
| 102 | PyObject *obvalue=Py_None; |
| 103 | int id=0; |
| 104 | int flags; |
| 105 | if (!PyArg_ParseTuple(args,"i|iO", |
| 106 | &flags, // @pyparm int|flags||Specifies information about the state of the new menu item when it is added to the menu. May be a combination of the win32con.MF_* values. |
| 107 | &id, // @pyparm int|id|0|Specifies either the command ID of the new menu item. |
| 108 | &obvalue)) // @pyparm string/None|value|None|Specifies the content of the new menu item. If used, flags must contain win32con.MF_STRING. |
| 109 | return NULL; |
| 110 | if (!PyWinObject_AsTCHAR(obvalue, &value, TRUE)) |
| 111 | return NULL; |
| 112 | if (!::AppendMenu( hMenu, flags, id, value)){ |
| 113 | PyWinObject_FreeTCHAR(value); |
| 114 | RETURN_API_ERR("::AppendMenu"); |
| 115 | } |
| 116 | PyWinObject_FreeTCHAR(value); |
| 117 | RETURN_NONE; |
| 118 | } |
| 119 | |
| 120 | // @pymethod string|PyCMenu|DeleteMenu|Deletes the specified menu item. |
| 121 | PyObject *PyCMenu::DeleteMenu(PyObject *self, PyObject *args) |
no outgoing calls
no test coverage detected