diff --git a/bindings/interface/MenuItem.cpp b/bindings/interface/MenuItem.cpp index 2f2fe32..2697109 100644 --- a/bindings/interface/MenuItem.cpp +++ b/bindings/interface/MenuItem.cpp @@ -41,7 +41,7 @@ PYBIND11_MODULE(MenuItem,m) //m.attr("MenuItemPrivate") = MenuItemPrivate; py::class_>(m, "BMenuItem") -.def(py::init(), "", py::arg("label"), py::arg("message"), py::arg("shortcut")=0, py::arg("modifiers")=0) +.def(py::init(), "", py::arg("label"), py::arg("message"), py::arg("shortcut")='\0', py::arg("modifiers")=0) .def(py::init(), "", py::arg("menu"), py::arg("message")=NULL) .def(py::init(), "", py::arg("data")) .def_static("Instantiate", &BMenuItem::Instantiate, "", py::arg("archive")) diff --git a/tests/menuItemShortcutDefault.py b/tests/menuItemShortcutDefault.py new file mode 100644 index 0000000..3becd2f --- /dev/null +++ b/tests/menuItemShortcutDefault.py @@ -0,0 +1,23 @@ +import gc + +from Be import BMenuItem, BMessage + + +message = BMessage(0x716D6903) + +item = BMenuItem( + "default shortcut", + message, +) + +if item.Label() != "default shortcut": + raise RuntimeError( + f"unexpected menu item label: {item.Label()!r}" + ) + +del item +del message + +gc.collect() + +print("BMENUITEM DEFAULT SHORTCUT REGRESSION TEST: PASS")