Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 1 | |
| 2 | /* ========================== Module Menu =========================== */ |
| 3 | |
| 4 | #include "Python.h" |
| 5 | |
| 6 | |
| 7 | |
| 8 | #define SystemSevenOrLater 1 |
| 9 | |
| 10 | #include "macglue.h" |
| 11 | #include <Memory.h> |
| 12 | #include <Dialogs.h> |
| 13 | #include <Menus.h> |
| 14 | #include <Controls.h> |
| 15 | |
| 16 | extern PyObject *ResObj_New(Handle); |
| 17 | extern int ResObj_Convert(PyObject *, Handle *); |
| 18 | |
| 19 | extern PyObject *WinObj_New(WindowPtr); |
| 20 | extern int WinObj_Convert(PyObject *, WindowPtr *); |
| 21 | |
| 22 | extern PyObject *DlgObj_New(DialogPtr); |
| 23 | extern int DlgObj_Convert(PyObject *, DialogPtr *); |
| 24 | extern PyTypeObject Dialog_Type; |
| 25 | #define DlgObj_Check(x) ((x)->ob_type == &Dialog_Type) |
| 26 | |
| 27 | extern PyObject *MenuObj_New(MenuHandle); |
| 28 | extern int MenuObj_Convert(PyObject *, MenuHandle *); |
| 29 | |
| 30 | extern PyObject *CtlObj_New(ControlHandle); |
| 31 | extern int CtlObj_Convert(PyObject *, ControlHandle *); |
| 32 | |
| 33 | extern PyObject *WinObj_WhichWindow(WindowPtr); |
| 34 | |
Guido van Rossum | 86c3af7 | 1995-03-19 22:42:51 +0000 | [diff] [blame] | 35 | #include <Devices.h> /* Defines OpenDeskAcc in universal headers */ |
| 36 | #include <Desk.h> /* Defines OpenDeskAcc in old headers */ |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 37 | #include <Menus.h> |
| 38 | |
| 39 | #define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */ |
| 40 | |
| 41 | static PyObject *Menu_Error; |
| 42 | |
| 43 | /* ------------------------ Object type Menu ------------------------ */ |
| 44 | |
| 45 | PyTypeObject Menu_Type; |
| 46 | |
| 47 | #define MenuObj_Check(x) ((x)->ob_type == &Menu_Type) |
| 48 | |
| 49 | typedef struct MenuObject { |
| 50 | PyObject_HEAD |
| 51 | MenuHandle ob_itself; |
| 52 | } MenuObject; |
| 53 | |
| 54 | PyObject *MenuObj_New(itself) |
Guido van Rossum | 227a423 | 1995-03-10 14:42:57 +0000 | [diff] [blame] | 55 | MenuHandle itself; |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 56 | { |
| 57 | MenuObject *it; |
| 58 | it = PyObject_NEW(MenuObject, &Menu_Type); |
| 59 | if (it == NULL) return NULL; |
| 60 | it->ob_itself = itself; |
| 61 | return (PyObject *)it; |
| 62 | } |
| 63 | MenuObj_Convert(v, p_itself) |
| 64 | PyObject *v; |
| 65 | MenuHandle *p_itself; |
| 66 | { |
| 67 | if (!MenuObj_Check(v)) |
| 68 | { |
| 69 | PyErr_SetString(PyExc_TypeError, "Menu required"); |
| 70 | return 0; |
| 71 | } |
| 72 | *p_itself = ((MenuObject *)v)->ob_itself; |
| 73 | return 1; |
| 74 | } |
| 75 | |
| 76 | static void MenuObj_dealloc(self) |
| 77 | MenuObject *self; |
| 78 | { |
| 79 | /* Cleanup of self->ob_itself goes here */ |
| 80 | PyMem_DEL(self); |
| 81 | } |
| 82 | |
| 83 | static PyObject *MenuObj_DisposeMenu(_self, _args) |
| 84 | MenuObject *_self; |
| 85 | PyObject *_args; |
| 86 | { |
| 87 | PyObject *_res = NULL; |
| 88 | if (!PyArg_ParseTuple(_args, "")) |
| 89 | return NULL; |
| 90 | DisposeMenu(_self->ob_itself); |
| 91 | Py_INCREF(Py_None); |
| 92 | _res = Py_None; |
| 93 | return _res; |
| 94 | } |
| 95 | |
| 96 | static PyObject *MenuObj_AppendMenu(_self, _args) |
| 97 | MenuObject *_self; |
| 98 | PyObject *_args; |
| 99 | { |
| 100 | PyObject *_res = NULL; |
| 101 | Str255 data; |
| 102 | if (!PyArg_ParseTuple(_args, "O&", |
| 103 | PyMac_GetStr255, data)) |
| 104 | return NULL; |
| 105 | AppendMenu(_self->ob_itself, |
| 106 | data); |
| 107 | Py_INCREF(Py_None); |
| 108 | _res = Py_None; |
| 109 | return _res; |
| 110 | } |
| 111 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 112 | static PyObject *MenuObj_AppendResMenu(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 113 | MenuObject *_self; |
| 114 | PyObject *_args; |
| 115 | { |
| 116 | PyObject *_res = NULL; |
| 117 | ResType theType; |
| 118 | if (!PyArg_ParseTuple(_args, "O&", |
| 119 | PyMac_GetOSType, &theType)) |
| 120 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 121 | AppendResMenu(_self->ob_itself, |
| 122 | theType); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 123 | Py_INCREF(Py_None); |
| 124 | _res = Py_None; |
| 125 | return _res; |
| 126 | } |
| 127 | |
| 128 | static PyObject *MenuObj_InsertResMenu(_self, _args) |
| 129 | MenuObject *_self; |
| 130 | PyObject *_args; |
| 131 | { |
| 132 | PyObject *_res = NULL; |
| 133 | ResType theType; |
| 134 | short afterItem; |
| 135 | if (!PyArg_ParseTuple(_args, "O&h", |
| 136 | PyMac_GetOSType, &theType, |
| 137 | &afterItem)) |
| 138 | return NULL; |
| 139 | InsertResMenu(_self->ob_itself, |
| 140 | theType, |
| 141 | afterItem); |
| 142 | Py_INCREF(Py_None); |
| 143 | _res = Py_None; |
| 144 | return _res; |
| 145 | } |
| 146 | |
| 147 | static PyObject *MenuObj_InsertMenu(_self, _args) |
| 148 | MenuObject *_self; |
| 149 | PyObject *_args; |
| 150 | { |
| 151 | PyObject *_res = NULL; |
| 152 | short beforeID; |
| 153 | if (!PyArg_ParseTuple(_args, "h", |
| 154 | &beforeID)) |
| 155 | return NULL; |
| 156 | InsertMenu(_self->ob_itself, |
| 157 | beforeID); |
| 158 | Py_INCREF(Py_None); |
| 159 | _res = Py_None; |
| 160 | return _res; |
| 161 | } |
| 162 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 163 | static PyObject *MenuObj_InsertMenuItem(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 164 | MenuObject *_self; |
| 165 | PyObject *_args; |
| 166 | { |
| 167 | PyObject *_res = NULL; |
| 168 | Str255 itemString; |
| 169 | short afterItem; |
| 170 | if (!PyArg_ParseTuple(_args, "O&h", |
| 171 | PyMac_GetStr255, itemString, |
| 172 | &afterItem)) |
| 173 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 174 | InsertMenuItem(_self->ob_itself, |
| 175 | itemString, |
| 176 | afterItem); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 177 | Py_INCREF(Py_None); |
| 178 | _res = Py_None; |
| 179 | return _res; |
| 180 | } |
| 181 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 182 | static PyObject *MenuObj_DeleteMenuItem(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 183 | MenuObject *_self; |
| 184 | PyObject *_args; |
| 185 | { |
| 186 | PyObject *_res = NULL; |
| 187 | short item; |
| 188 | if (!PyArg_ParseTuple(_args, "h", |
| 189 | &item)) |
| 190 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 191 | DeleteMenuItem(_self->ob_itself, |
| 192 | item); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 193 | Py_INCREF(Py_None); |
| 194 | _res = Py_None; |
| 195 | return _res; |
| 196 | } |
| 197 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 198 | static PyObject *MenuObj_SetMenuItemText(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 199 | MenuObject *_self; |
| 200 | PyObject *_args; |
| 201 | { |
| 202 | PyObject *_res = NULL; |
| 203 | short item; |
| 204 | Str255 itemString; |
| 205 | if (!PyArg_ParseTuple(_args, "hO&", |
| 206 | &item, |
| 207 | PyMac_GetStr255, itemString)) |
| 208 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 209 | SetMenuItemText(_self->ob_itself, |
| 210 | item, |
| 211 | itemString); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 212 | Py_INCREF(Py_None); |
| 213 | _res = Py_None; |
| 214 | return _res; |
| 215 | } |
| 216 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 217 | static PyObject *MenuObj_GetMenuItemText(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 218 | MenuObject *_self; |
| 219 | PyObject *_args; |
| 220 | { |
| 221 | PyObject *_res = NULL; |
| 222 | short item; |
| 223 | Str255 itemString; |
| 224 | if (!PyArg_ParseTuple(_args, "h", |
| 225 | &item)) |
| 226 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 227 | GetMenuItemText(_self->ob_itself, |
| 228 | item, |
| 229 | itemString); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 230 | _res = Py_BuildValue("O&", |
| 231 | PyMac_BuildStr255, itemString); |
| 232 | return _res; |
| 233 | } |
| 234 | |
| 235 | static PyObject *MenuObj_DisableItem(_self, _args) |
| 236 | MenuObject *_self; |
| 237 | PyObject *_args; |
| 238 | { |
| 239 | PyObject *_res = NULL; |
| 240 | short item; |
| 241 | if (!PyArg_ParseTuple(_args, "h", |
| 242 | &item)) |
| 243 | return NULL; |
| 244 | DisableItem(_self->ob_itself, |
| 245 | item); |
| 246 | Py_INCREF(Py_None); |
| 247 | _res = Py_None; |
| 248 | return _res; |
| 249 | } |
| 250 | |
| 251 | static PyObject *MenuObj_EnableItem(_self, _args) |
| 252 | MenuObject *_self; |
| 253 | PyObject *_args; |
| 254 | { |
| 255 | PyObject *_res = NULL; |
| 256 | short item; |
| 257 | if (!PyArg_ParseTuple(_args, "h", |
| 258 | &item)) |
| 259 | return NULL; |
| 260 | EnableItem(_self->ob_itself, |
| 261 | item); |
| 262 | Py_INCREF(Py_None); |
| 263 | _res = Py_None; |
| 264 | return _res; |
| 265 | } |
| 266 | |
| 267 | static PyObject *MenuObj_CheckItem(_self, _args) |
| 268 | MenuObject *_self; |
| 269 | PyObject *_args; |
| 270 | { |
| 271 | PyObject *_res = NULL; |
| 272 | short item; |
| 273 | Boolean checked; |
| 274 | if (!PyArg_ParseTuple(_args, "hb", |
| 275 | &item, |
| 276 | &checked)) |
| 277 | return NULL; |
| 278 | CheckItem(_self->ob_itself, |
| 279 | item, |
| 280 | checked); |
| 281 | Py_INCREF(Py_None); |
| 282 | _res = Py_None; |
| 283 | return _res; |
| 284 | } |
| 285 | |
| 286 | static PyObject *MenuObj_SetItemMark(_self, _args) |
| 287 | MenuObject *_self; |
| 288 | PyObject *_args; |
| 289 | { |
| 290 | PyObject *_res = NULL; |
| 291 | short item; |
| 292 | short markChar; |
| 293 | if (!PyArg_ParseTuple(_args, "hh", |
| 294 | &item, |
| 295 | &markChar)) |
| 296 | return NULL; |
| 297 | SetItemMark(_self->ob_itself, |
| 298 | item, |
| 299 | markChar); |
| 300 | Py_INCREF(Py_None); |
| 301 | _res = Py_None; |
| 302 | return _res; |
| 303 | } |
| 304 | |
| 305 | static PyObject *MenuObj_GetItemMark(_self, _args) |
| 306 | MenuObject *_self; |
| 307 | PyObject *_args; |
| 308 | { |
| 309 | PyObject *_res = NULL; |
| 310 | short item; |
| 311 | short markChar; |
| 312 | if (!PyArg_ParseTuple(_args, "h", |
| 313 | &item)) |
| 314 | return NULL; |
| 315 | GetItemMark(_self->ob_itself, |
| 316 | item, |
| 317 | &markChar); |
| 318 | _res = Py_BuildValue("h", |
| 319 | markChar); |
| 320 | return _res; |
| 321 | } |
| 322 | |
| 323 | static PyObject *MenuObj_SetItemIcon(_self, _args) |
| 324 | MenuObject *_self; |
| 325 | PyObject *_args; |
| 326 | { |
| 327 | PyObject *_res = NULL; |
| 328 | short item; |
| 329 | short iconIndex; |
| 330 | if (!PyArg_ParseTuple(_args, "hh", |
| 331 | &item, |
| 332 | &iconIndex)) |
| 333 | return NULL; |
| 334 | SetItemIcon(_self->ob_itself, |
| 335 | item, |
| 336 | iconIndex); |
| 337 | Py_INCREF(Py_None); |
| 338 | _res = Py_None; |
| 339 | return _res; |
| 340 | } |
| 341 | |
| 342 | static PyObject *MenuObj_GetItemIcon(_self, _args) |
| 343 | MenuObject *_self; |
| 344 | PyObject *_args; |
| 345 | { |
| 346 | PyObject *_res = NULL; |
| 347 | short item; |
| 348 | short iconIndex; |
| 349 | if (!PyArg_ParseTuple(_args, "h", |
| 350 | &item)) |
| 351 | return NULL; |
| 352 | GetItemIcon(_self->ob_itself, |
| 353 | item, |
| 354 | &iconIndex); |
| 355 | _res = Py_BuildValue("h", |
| 356 | iconIndex); |
| 357 | return _res; |
| 358 | } |
| 359 | |
| 360 | static PyObject *MenuObj_SetItemStyle(_self, _args) |
| 361 | MenuObject *_self; |
| 362 | PyObject *_args; |
| 363 | { |
| 364 | PyObject *_res = NULL; |
| 365 | short item; |
| 366 | short chStyle; |
| 367 | if (!PyArg_ParseTuple(_args, "hh", |
| 368 | &item, |
| 369 | &chStyle)) |
| 370 | return NULL; |
| 371 | SetItemStyle(_self->ob_itself, |
| 372 | item, |
| 373 | chStyle); |
| 374 | Py_INCREF(Py_None); |
| 375 | _res = Py_None; |
| 376 | return _res; |
| 377 | } |
| 378 | |
| 379 | static PyObject *MenuObj_GetItemStyle(_self, _args) |
| 380 | MenuObject *_self; |
| 381 | PyObject *_args; |
| 382 | { |
| 383 | PyObject *_res = NULL; |
| 384 | short item; |
Jack Jansen | 7d0bc83 | 1995-06-09 20:56:31 +0000 | [diff] [blame^] | 385 | Style chStyle; |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 386 | if (!PyArg_ParseTuple(_args, "h", |
| 387 | &item)) |
| 388 | return NULL; |
| 389 | GetItemStyle(_self->ob_itself, |
| 390 | item, |
| 391 | &chStyle); |
| 392 | _res = Py_BuildValue("b", |
| 393 | chStyle); |
| 394 | return _res; |
| 395 | } |
| 396 | |
| 397 | static PyObject *MenuObj_CalcMenuSize(_self, _args) |
| 398 | MenuObject *_self; |
| 399 | PyObject *_args; |
| 400 | { |
| 401 | PyObject *_res = NULL; |
| 402 | if (!PyArg_ParseTuple(_args, "")) |
| 403 | return NULL; |
| 404 | CalcMenuSize(_self->ob_itself); |
| 405 | Py_INCREF(Py_None); |
| 406 | _res = Py_None; |
| 407 | return _res; |
| 408 | } |
| 409 | |
| 410 | static PyObject *MenuObj_CountMItems(_self, _args) |
| 411 | MenuObject *_self; |
| 412 | PyObject *_args; |
| 413 | { |
| 414 | PyObject *_res = NULL; |
| 415 | short _rv; |
| 416 | if (!PyArg_ParseTuple(_args, "")) |
| 417 | return NULL; |
| 418 | _rv = CountMItems(_self->ob_itself); |
| 419 | _res = Py_BuildValue("h", |
| 420 | _rv); |
| 421 | return _res; |
| 422 | } |
| 423 | |
| 424 | static PyObject *MenuObj_GetItemCmd(_self, _args) |
| 425 | MenuObject *_self; |
| 426 | PyObject *_args; |
| 427 | { |
| 428 | PyObject *_res = NULL; |
| 429 | short item; |
| 430 | short cmdChar; |
| 431 | if (!PyArg_ParseTuple(_args, "h", |
| 432 | &item)) |
| 433 | return NULL; |
| 434 | GetItemCmd(_self->ob_itself, |
| 435 | item, |
| 436 | &cmdChar); |
| 437 | _res = Py_BuildValue("h", |
| 438 | cmdChar); |
| 439 | return _res; |
| 440 | } |
| 441 | |
| 442 | static PyObject *MenuObj_SetItemCmd(_self, _args) |
| 443 | MenuObject *_self; |
| 444 | PyObject *_args; |
| 445 | { |
| 446 | PyObject *_res = NULL; |
| 447 | short item; |
| 448 | short cmdChar; |
| 449 | if (!PyArg_ParseTuple(_args, "hh", |
| 450 | &item, |
| 451 | &cmdChar)) |
| 452 | return NULL; |
| 453 | SetItemCmd(_self->ob_itself, |
| 454 | item, |
| 455 | cmdChar); |
| 456 | Py_INCREF(Py_None); |
| 457 | _res = Py_None; |
| 458 | return _res; |
| 459 | } |
| 460 | |
| 461 | static PyObject *MenuObj_PopUpMenuSelect(_self, _args) |
| 462 | MenuObject *_self; |
| 463 | PyObject *_args; |
| 464 | { |
| 465 | PyObject *_res = NULL; |
| 466 | long _rv; |
| 467 | short top; |
| 468 | short left; |
| 469 | short popUpItem; |
| 470 | if (!PyArg_ParseTuple(_args, "hhh", |
| 471 | &top, |
| 472 | &left, |
| 473 | &popUpItem)) |
| 474 | return NULL; |
| 475 | _rv = PopUpMenuSelect(_self->ob_itself, |
| 476 | top, |
| 477 | left, |
| 478 | popUpItem); |
| 479 | _res = Py_BuildValue("l", |
| 480 | _rv); |
| 481 | return _res; |
| 482 | } |
| 483 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 484 | static PyObject *MenuObj_InsertFontResMenu(_self, _args) |
| 485 | MenuObject *_self; |
| 486 | PyObject *_args; |
| 487 | { |
| 488 | PyObject *_res = NULL; |
| 489 | short afterItem; |
| 490 | short scriptFilter; |
| 491 | if (!PyArg_ParseTuple(_args, "hh", |
| 492 | &afterItem, |
| 493 | &scriptFilter)) |
| 494 | return NULL; |
| 495 | InsertFontResMenu(_self->ob_itself, |
| 496 | afterItem, |
| 497 | scriptFilter); |
| 498 | Py_INCREF(Py_None); |
| 499 | _res = Py_None; |
| 500 | return _res; |
| 501 | } |
| 502 | |
| 503 | static PyObject *MenuObj_InsertIntlResMenu(_self, _args) |
| 504 | MenuObject *_self; |
| 505 | PyObject *_args; |
| 506 | { |
| 507 | PyObject *_res = NULL; |
| 508 | ResType theType; |
| 509 | short afterItem; |
| 510 | short scriptFilter; |
| 511 | if (!PyArg_ParseTuple(_args, "O&hh", |
| 512 | PyMac_GetOSType, &theType, |
| 513 | &afterItem, |
| 514 | &scriptFilter)) |
| 515 | return NULL; |
| 516 | InsertIntlResMenu(_self->ob_itself, |
| 517 | theType, |
| 518 | afterItem, |
| 519 | scriptFilter); |
| 520 | Py_INCREF(Py_None); |
| 521 | _res = Py_None; |
| 522 | return _res; |
| 523 | } |
| 524 | |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 525 | static PyMethodDef MenuObj_methods[] = { |
| 526 | {"DisposeMenu", (PyCFunction)MenuObj_DisposeMenu, 1, |
| 527 | "() -> None"}, |
| 528 | {"AppendMenu", (PyCFunction)MenuObj_AppendMenu, 1, |
| 529 | "(Str255 data) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 530 | {"AppendResMenu", (PyCFunction)MenuObj_AppendResMenu, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 531 | "(ResType theType) -> None"}, |
| 532 | {"InsertResMenu", (PyCFunction)MenuObj_InsertResMenu, 1, |
| 533 | "(ResType theType, short afterItem) -> None"}, |
| 534 | {"InsertMenu", (PyCFunction)MenuObj_InsertMenu, 1, |
| 535 | "(short beforeID) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 536 | {"InsertMenuItem", (PyCFunction)MenuObj_InsertMenuItem, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 537 | "(Str255 itemString, short afterItem) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 538 | {"DeleteMenuItem", (PyCFunction)MenuObj_DeleteMenuItem, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 539 | "(short item) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 540 | {"SetMenuItemText", (PyCFunction)MenuObj_SetMenuItemText, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 541 | "(short item, Str255 itemString) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 542 | {"GetMenuItemText", (PyCFunction)MenuObj_GetMenuItemText, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 543 | "(short item) -> (Str255 itemString)"}, |
| 544 | {"DisableItem", (PyCFunction)MenuObj_DisableItem, 1, |
| 545 | "(short item) -> None"}, |
| 546 | {"EnableItem", (PyCFunction)MenuObj_EnableItem, 1, |
| 547 | "(short item) -> None"}, |
| 548 | {"CheckItem", (PyCFunction)MenuObj_CheckItem, 1, |
| 549 | "(short item, Boolean checked) -> None"}, |
| 550 | {"SetItemMark", (PyCFunction)MenuObj_SetItemMark, 1, |
| 551 | "(short item, short markChar) -> None"}, |
| 552 | {"GetItemMark", (PyCFunction)MenuObj_GetItemMark, 1, |
| 553 | "(short item) -> (short markChar)"}, |
| 554 | {"SetItemIcon", (PyCFunction)MenuObj_SetItemIcon, 1, |
| 555 | "(short item, short iconIndex) -> None"}, |
| 556 | {"GetItemIcon", (PyCFunction)MenuObj_GetItemIcon, 1, |
| 557 | "(short item) -> (short iconIndex)"}, |
| 558 | {"SetItemStyle", (PyCFunction)MenuObj_SetItemStyle, 1, |
| 559 | "(short item, short chStyle) -> None"}, |
| 560 | {"GetItemStyle", (PyCFunction)MenuObj_GetItemStyle, 1, |
Jack Jansen | 7d0bc83 | 1995-06-09 20:56:31 +0000 | [diff] [blame^] | 561 | "(short item) -> (Style chStyle)"}, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 562 | {"CalcMenuSize", (PyCFunction)MenuObj_CalcMenuSize, 1, |
| 563 | "() -> None"}, |
| 564 | {"CountMItems", (PyCFunction)MenuObj_CountMItems, 1, |
| 565 | "() -> (short _rv)"}, |
| 566 | {"GetItemCmd", (PyCFunction)MenuObj_GetItemCmd, 1, |
| 567 | "(short item) -> (short cmdChar)"}, |
| 568 | {"SetItemCmd", (PyCFunction)MenuObj_SetItemCmd, 1, |
| 569 | "(short item, short cmdChar) -> None"}, |
| 570 | {"PopUpMenuSelect", (PyCFunction)MenuObj_PopUpMenuSelect, 1, |
| 571 | "(short top, short left, short popUpItem) -> (long _rv)"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 572 | {"InsertFontResMenu", (PyCFunction)MenuObj_InsertFontResMenu, 1, |
| 573 | "(short afterItem, short scriptFilter) -> None"}, |
| 574 | {"InsertIntlResMenu", (PyCFunction)MenuObj_InsertIntlResMenu, 1, |
| 575 | "(ResType theType, short afterItem, short scriptFilter) -> None"}, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 576 | {NULL, NULL, 0} |
| 577 | }; |
| 578 | |
| 579 | PyMethodChain MenuObj_chain = { MenuObj_methods, NULL }; |
| 580 | |
| 581 | static PyObject *MenuObj_getattr(self, name) |
| 582 | MenuObject *self; |
| 583 | char *name; |
| 584 | { |
| 585 | return Py_FindMethodInChain(&MenuObj_chain, (PyObject *)self, name); |
| 586 | } |
| 587 | |
| 588 | #define MenuObj_setattr NULL |
| 589 | |
| 590 | PyTypeObject Menu_Type = { |
| 591 | PyObject_HEAD_INIT(&PyType_Type) |
| 592 | 0, /*ob_size*/ |
| 593 | "Menu", /*tp_name*/ |
| 594 | sizeof(MenuObject), /*tp_basicsize*/ |
| 595 | 0, /*tp_itemsize*/ |
| 596 | /* methods */ |
| 597 | (destructor) MenuObj_dealloc, /*tp_dealloc*/ |
| 598 | 0, /*tp_print*/ |
| 599 | (getattrfunc) MenuObj_getattr, /*tp_getattr*/ |
| 600 | (setattrfunc) MenuObj_setattr, /*tp_setattr*/ |
| 601 | }; |
| 602 | |
| 603 | /* ---------------------- End object type Menu ---------------------- */ |
| 604 | |
| 605 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 606 | static PyObject *Menu_GetMBarHeight(_self, _args) |
| 607 | PyObject *_self; |
| 608 | PyObject *_args; |
| 609 | { |
| 610 | PyObject *_res = NULL; |
| 611 | short _rv; |
| 612 | if (!PyArg_ParseTuple(_args, "")) |
| 613 | return NULL; |
| 614 | _rv = GetMBarHeight(); |
| 615 | _res = Py_BuildValue("h", |
| 616 | _rv); |
| 617 | return _res; |
| 618 | } |
| 619 | |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 620 | static PyObject *Menu_InitMenus(_self, _args) |
| 621 | PyObject *_self; |
| 622 | PyObject *_args; |
| 623 | { |
| 624 | PyObject *_res = NULL; |
| 625 | if (!PyArg_ParseTuple(_args, "")) |
| 626 | return NULL; |
| 627 | InitMenus(); |
| 628 | Py_INCREF(Py_None); |
| 629 | _res = Py_None; |
| 630 | return _res; |
| 631 | } |
| 632 | |
| 633 | static PyObject *Menu_NewMenu(_self, _args) |
| 634 | PyObject *_self; |
| 635 | PyObject *_args; |
| 636 | { |
| 637 | PyObject *_res = NULL; |
| 638 | MenuHandle _rv; |
| 639 | short menuID; |
| 640 | Str255 menuTitle; |
| 641 | if (!PyArg_ParseTuple(_args, "hO&", |
| 642 | &menuID, |
| 643 | PyMac_GetStr255, menuTitle)) |
| 644 | return NULL; |
| 645 | _rv = NewMenu(menuID, |
| 646 | menuTitle); |
| 647 | _res = Py_BuildValue("O&", |
| 648 | MenuObj_New, _rv); |
| 649 | return _res; |
| 650 | } |
| 651 | |
| 652 | static PyObject *Menu_GetMenu(_self, _args) |
| 653 | PyObject *_self; |
| 654 | PyObject *_args; |
| 655 | { |
| 656 | PyObject *_res = NULL; |
| 657 | MenuHandle _rv; |
| 658 | short resourceID; |
| 659 | if (!PyArg_ParseTuple(_args, "h", |
| 660 | &resourceID)) |
| 661 | return NULL; |
| 662 | _rv = GetMenu(resourceID); |
| 663 | _res = Py_BuildValue("O&", |
| 664 | MenuObj_New, _rv); |
| 665 | return _res; |
| 666 | } |
| 667 | |
| 668 | static PyObject *Menu_DrawMenuBar(_self, _args) |
| 669 | PyObject *_self; |
| 670 | PyObject *_args; |
| 671 | { |
| 672 | PyObject *_res = NULL; |
| 673 | if (!PyArg_ParseTuple(_args, "")) |
| 674 | return NULL; |
| 675 | DrawMenuBar(); |
| 676 | Py_INCREF(Py_None); |
| 677 | _res = Py_None; |
| 678 | return _res; |
| 679 | } |
| 680 | |
| 681 | static PyObject *Menu_InvalMenuBar(_self, _args) |
| 682 | PyObject *_self; |
| 683 | PyObject *_args; |
| 684 | { |
| 685 | PyObject *_res = NULL; |
| 686 | if (!PyArg_ParseTuple(_args, "")) |
| 687 | return NULL; |
| 688 | InvalMenuBar(); |
| 689 | Py_INCREF(Py_None); |
| 690 | _res = Py_None; |
| 691 | return _res; |
| 692 | } |
| 693 | |
| 694 | static PyObject *Menu_DeleteMenu(_self, _args) |
| 695 | PyObject *_self; |
| 696 | PyObject *_args; |
| 697 | { |
| 698 | PyObject *_res = NULL; |
| 699 | short menuID; |
| 700 | if (!PyArg_ParseTuple(_args, "h", |
| 701 | &menuID)) |
| 702 | return NULL; |
| 703 | DeleteMenu(menuID); |
| 704 | Py_INCREF(Py_None); |
| 705 | _res = Py_None; |
| 706 | return _res; |
| 707 | } |
| 708 | |
| 709 | static PyObject *Menu_ClearMenuBar(_self, _args) |
| 710 | PyObject *_self; |
| 711 | PyObject *_args; |
| 712 | { |
| 713 | PyObject *_res = NULL; |
| 714 | if (!PyArg_ParseTuple(_args, "")) |
| 715 | return NULL; |
| 716 | ClearMenuBar(); |
| 717 | Py_INCREF(Py_None); |
| 718 | _res = Py_None; |
| 719 | return _res; |
| 720 | } |
| 721 | |
| 722 | static PyObject *Menu_GetNewMBar(_self, _args) |
| 723 | PyObject *_self; |
| 724 | PyObject *_args; |
| 725 | { |
| 726 | PyObject *_res = NULL; |
| 727 | Handle _rv; |
| 728 | short menuBarID; |
| 729 | if (!PyArg_ParseTuple(_args, "h", |
| 730 | &menuBarID)) |
| 731 | return NULL; |
| 732 | _rv = GetNewMBar(menuBarID); |
| 733 | _res = Py_BuildValue("O&", |
| 734 | ResObj_New, _rv); |
| 735 | return _res; |
| 736 | } |
| 737 | |
| 738 | static PyObject *Menu_GetMenuBar(_self, _args) |
| 739 | PyObject *_self; |
| 740 | PyObject *_args; |
| 741 | { |
| 742 | PyObject *_res = NULL; |
| 743 | Handle _rv; |
| 744 | if (!PyArg_ParseTuple(_args, "")) |
| 745 | return NULL; |
| 746 | _rv = GetMenuBar(); |
| 747 | _res = Py_BuildValue("O&", |
| 748 | ResObj_New, _rv); |
| 749 | return _res; |
| 750 | } |
| 751 | |
| 752 | static PyObject *Menu_SetMenuBar(_self, _args) |
| 753 | PyObject *_self; |
| 754 | PyObject *_args; |
| 755 | { |
| 756 | PyObject *_res = NULL; |
| 757 | Handle menuList; |
| 758 | if (!PyArg_ParseTuple(_args, "O&", |
| 759 | ResObj_Convert, &menuList)) |
| 760 | return NULL; |
| 761 | SetMenuBar(menuList); |
| 762 | Py_INCREF(Py_None); |
| 763 | _res = Py_None; |
| 764 | return _res; |
| 765 | } |
| 766 | |
| 767 | static PyObject *Menu_MenuKey(_self, _args) |
| 768 | PyObject *_self; |
| 769 | PyObject *_args; |
| 770 | { |
| 771 | PyObject *_res = NULL; |
| 772 | long _rv; |
| 773 | short ch; |
| 774 | if (!PyArg_ParseTuple(_args, "h", |
| 775 | &ch)) |
| 776 | return NULL; |
| 777 | _rv = MenuKey(ch); |
| 778 | _res = Py_BuildValue("l", |
| 779 | _rv); |
| 780 | return _res; |
| 781 | } |
| 782 | |
| 783 | static PyObject *Menu_HiliteMenu(_self, _args) |
| 784 | PyObject *_self; |
| 785 | PyObject *_args; |
| 786 | { |
| 787 | PyObject *_res = NULL; |
| 788 | short menuID; |
| 789 | if (!PyArg_ParseTuple(_args, "h", |
| 790 | &menuID)) |
| 791 | return NULL; |
| 792 | HiliteMenu(menuID); |
| 793 | Py_INCREF(Py_None); |
| 794 | _res = Py_None; |
| 795 | return _res; |
| 796 | } |
| 797 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 798 | static PyObject *Menu_GetMenuHandle(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 799 | PyObject *_self; |
| 800 | PyObject *_args; |
| 801 | { |
| 802 | PyObject *_res = NULL; |
| 803 | MenuHandle _rv; |
| 804 | short menuID; |
| 805 | if (!PyArg_ParseTuple(_args, "h", |
| 806 | &menuID)) |
| 807 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 808 | _rv = GetMenuHandle(menuID); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 809 | _res = Py_BuildValue("O&", |
| 810 | MenuObj_New, _rv); |
| 811 | return _res; |
| 812 | } |
| 813 | |
| 814 | static PyObject *Menu_FlashMenuBar(_self, _args) |
| 815 | PyObject *_self; |
| 816 | PyObject *_args; |
| 817 | { |
| 818 | PyObject *_res = NULL; |
| 819 | short menuID; |
| 820 | if (!PyArg_ParseTuple(_args, "h", |
| 821 | &menuID)) |
| 822 | return NULL; |
| 823 | FlashMenuBar(menuID); |
| 824 | Py_INCREF(Py_None); |
| 825 | _res = Py_None; |
| 826 | return _res; |
| 827 | } |
| 828 | |
| 829 | static PyObject *Menu_SetMenuFlash(_self, _args) |
| 830 | PyObject *_self; |
| 831 | PyObject *_args; |
| 832 | { |
| 833 | PyObject *_res = NULL; |
| 834 | short count; |
| 835 | if (!PyArg_ParseTuple(_args, "h", |
| 836 | &count)) |
| 837 | return NULL; |
| 838 | SetMenuFlash(count); |
| 839 | Py_INCREF(Py_None); |
| 840 | _res = Py_None; |
| 841 | return _res; |
| 842 | } |
| 843 | |
| 844 | static PyObject *Menu_MenuSelect(_self, _args) |
| 845 | PyObject *_self; |
| 846 | PyObject *_args; |
| 847 | { |
| 848 | PyObject *_res = NULL; |
| 849 | long _rv; |
| 850 | Point startPt; |
| 851 | if (!PyArg_ParseTuple(_args, "O&", |
| 852 | PyMac_GetPoint, &startPt)) |
| 853 | return NULL; |
| 854 | _rv = MenuSelect(startPt); |
| 855 | _res = Py_BuildValue("l", |
| 856 | _rv); |
| 857 | return _res; |
| 858 | } |
| 859 | |
| 860 | static PyObject *Menu_InitProcMenu(_self, _args) |
| 861 | PyObject *_self; |
| 862 | PyObject *_args; |
| 863 | { |
| 864 | PyObject *_res = NULL; |
| 865 | short resID; |
| 866 | if (!PyArg_ParseTuple(_args, "h", |
| 867 | &resID)) |
| 868 | return NULL; |
| 869 | InitProcMenu(resID); |
| 870 | Py_INCREF(Py_None); |
| 871 | _res = Py_None; |
| 872 | return _res; |
| 873 | } |
| 874 | |
| 875 | static PyObject *Menu_MenuChoice(_self, _args) |
| 876 | PyObject *_self; |
| 877 | PyObject *_args; |
| 878 | { |
| 879 | PyObject *_res = NULL; |
| 880 | long _rv; |
| 881 | if (!PyArg_ParseTuple(_args, "")) |
| 882 | return NULL; |
| 883 | _rv = MenuChoice(); |
| 884 | _res = Py_BuildValue("l", |
| 885 | _rv); |
| 886 | return _res; |
| 887 | } |
| 888 | |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 889 | static PyObject *Menu_DeleteMCEntries(_self, _args) |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 890 | PyObject *_self; |
| 891 | PyObject *_args; |
| 892 | { |
| 893 | PyObject *_res = NULL; |
| 894 | short menuID; |
| 895 | short menuItem; |
| 896 | if (!PyArg_ParseTuple(_args, "hh", |
| 897 | &menuID, |
| 898 | &menuItem)) |
| 899 | return NULL; |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 900 | DeleteMCEntries(menuID, |
| 901 | menuItem); |
| 902 | Py_INCREF(Py_None); |
| 903 | _res = Py_None; |
| 904 | return _res; |
| 905 | } |
| 906 | |
| 907 | static PyObject *Menu_SystemEdit(_self, _args) |
| 908 | PyObject *_self; |
| 909 | PyObject *_args; |
| 910 | { |
| 911 | PyObject *_res = NULL; |
| 912 | Boolean _rv; |
| 913 | short editCmd; |
| 914 | if (!PyArg_ParseTuple(_args, "h", |
| 915 | &editCmd)) |
| 916 | return NULL; |
| 917 | _rv = SystemEdit(editCmd); |
| 918 | _res = Py_BuildValue("b", |
| 919 | _rv); |
| 920 | return _res; |
| 921 | } |
| 922 | |
| 923 | static PyObject *Menu_SystemMenu(_self, _args) |
| 924 | PyObject *_self; |
| 925 | PyObject *_args; |
| 926 | { |
| 927 | PyObject *_res = NULL; |
| 928 | long menuResult; |
| 929 | if (!PyArg_ParseTuple(_args, "l", |
| 930 | &menuResult)) |
| 931 | return NULL; |
| 932 | SystemMenu(menuResult); |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 933 | Py_INCREF(Py_None); |
| 934 | _res = Py_None; |
| 935 | return _res; |
| 936 | } |
| 937 | |
Guido van Rossum | 86c3af7 | 1995-03-19 22:42:51 +0000 | [diff] [blame] | 938 | static PyObject *Menu_OpenDeskAcc(_self, _args) |
| 939 | PyObject *_self; |
| 940 | PyObject *_args; |
| 941 | { |
| 942 | PyObject *_res = NULL; |
| 943 | Str255 name; |
| 944 | if (!PyArg_ParseTuple(_args, "O&", |
| 945 | PyMac_GetStr255, name)) |
| 946 | return NULL; |
| 947 | OpenDeskAcc(name); |
| 948 | Py_INCREF(Py_None); |
| 949 | _res = Py_None; |
| 950 | return _res; |
| 951 | } |
| 952 | |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 953 | static PyMethodDef Menu_methods[] = { |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 954 | {"GetMBarHeight", (PyCFunction)Menu_GetMBarHeight, 1, |
| 955 | "() -> (short _rv)"}, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 956 | {"InitMenus", (PyCFunction)Menu_InitMenus, 1, |
| 957 | "() -> None"}, |
| 958 | {"NewMenu", (PyCFunction)Menu_NewMenu, 1, |
| 959 | "(short menuID, Str255 menuTitle) -> (MenuHandle _rv)"}, |
| 960 | {"GetMenu", (PyCFunction)Menu_GetMenu, 1, |
| 961 | "(short resourceID) -> (MenuHandle _rv)"}, |
| 962 | {"DrawMenuBar", (PyCFunction)Menu_DrawMenuBar, 1, |
| 963 | "() -> None"}, |
| 964 | {"InvalMenuBar", (PyCFunction)Menu_InvalMenuBar, 1, |
| 965 | "() -> None"}, |
| 966 | {"DeleteMenu", (PyCFunction)Menu_DeleteMenu, 1, |
| 967 | "(short menuID) -> None"}, |
| 968 | {"ClearMenuBar", (PyCFunction)Menu_ClearMenuBar, 1, |
| 969 | "() -> None"}, |
| 970 | {"GetNewMBar", (PyCFunction)Menu_GetNewMBar, 1, |
| 971 | "(short menuBarID) -> (Handle _rv)"}, |
| 972 | {"GetMenuBar", (PyCFunction)Menu_GetMenuBar, 1, |
| 973 | "() -> (Handle _rv)"}, |
| 974 | {"SetMenuBar", (PyCFunction)Menu_SetMenuBar, 1, |
| 975 | "(Handle menuList) -> None"}, |
| 976 | {"MenuKey", (PyCFunction)Menu_MenuKey, 1, |
| 977 | "(short ch) -> (long _rv)"}, |
| 978 | {"HiliteMenu", (PyCFunction)Menu_HiliteMenu, 1, |
| 979 | "(short menuID) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 980 | {"GetMenuHandle", (PyCFunction)Menu_GetMenuHandle, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 981 | "(short menuID) -> (MenuHandle _rv)"}, |
| 982 | {"FlashMenuBar", (PyCFunction)Menu_FlashMenuBar, 1, |
| 983 | "(short menuID) -> None"}, |
| 984 | {"SetMenuFlash", (PyCFunction)Menu_SetMenuFlash, 1, |
| 985 | "(short count) -> None"}, |
| 986 | {"MenuSelect", (PyCFunction)Menu_MenuSelect, 1, |
| 987 | "(Point startPt) -> (long _rv)"}, |
| 988 | {"InitProcMenu", (PyCFunction)Menu_InitProcMenu, 1, |
| 989 | "(short resID) -> None"}, |
| 990 | {"MenuChoice", (PyCFunction)Menu_MenuChoice, 1, |
| 991 | "() -> (long _rv)"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 992 | {"DeleteMCEntries", (PyCFunction)Menu_DeleteMCEntries, 1, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 993 | "(short menuID, short menuItem) -> None"}, |
Jack Jansen | b81cf9d | 1995-06-06 13:08:40 +0000 | [diff] [blame] | 994 | {"SystemEdit", (PyCFunction)Menu_SystemEdit, 1, |
| 995 | "(short editCmd) -> (Boolean _rv)"}, |
| 996 | {"SystemMenu", (PyCFunction)Menu_SystemMenu, 1, |
| 997 | "(long menuResult) -> None"}, |
Guido van Rossum | 86c3af7 | 1995-03-19 22:42:51 +0000 | [diff] [blame] | 998 | {"OpenDeskAcc", (PyCFunction)Menu_OpenDeskAcc, 1, |
| 999 | "(Str255 name) -> None"}, |
Guido van Rossum | 17448e2 | 1995-01-30 11:53:55 +0000 | [diff] [blame] | 1000 | {NULL, NULL, 0} |
| 1001 | }; |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | |
| 1006 | void initMenu() |
| 1007 | { |
| 1008 | PyObject *m; |
| 1009 | PyObject *d; |
| 1010 | |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | m = Py_InitModule("Menu", Menu_methods); |
| 1015 | d = PyModule_GetDict(m); |
| 1016 | Menu_Error = PyMac_GetOSErrException(); |
| 1017 | if (Menu_Error == NULL || |
| 1018 | PyDict_SetItemString(d, "Error", Menu_Error) != 0) |
| 1019 | Py_FatalError("can't initialize Menu.Error"); |
| 1020 | } |
| 1021 | |
| 1022 | /* ======================== End module Menu ========================= */ |
| 1023 | |