diff --git a/bindings/interface/Control.cpp b/bindings/interface/Control.cpp index 31f559b..bf9beff 100644 --- a/bindings/interface/Control.cpp +++ b/bindings/interface/Control.cpp @@ -92,7 +92,7 @@ m.attr("B_CONTROL_PARTIALLY_ON") = 2; //m.attr("BIcon") = BIcon; -py::class_(m, "BControl") +py::class_>(m, "BControl") .def(py::init(), "", py::arg("frame"), py::arg("name"), py::arg("label"), py::arg("message"), py::arg("resizingMode"), py::arg("flags")) .def(py::init(), "", py::arg("name"), py::arg("label"), py::arg("message"), py::arg("flags")) .def(py::init(), "", py::arg("data")) diff --git a/tests/controlHolderOwnership.py b/tests/controlHolderOwnership.py new file mode 100644 index 0000000..ec6baad --- /dev/null +++ b/tests/controlHolderOwnership.py @@ -0,0 +1,43 @@ +import gc + +from Be import ( + BApplication, + BControl, + BRect, + BWindow, + B_NOT_RESIZABLE, + window_type, +) + + +application = BApplication( + "application/x-vnd.haiku-pyapi-bcontrol-holder-test" +) + +window = BWindow( + BRect(100.0, 100.0, 320.0, 220.0), + "BControl holder test", + window_type.B_TITLED_WINDOW, + B_NOT_RESIZABLE, +) + +control = BControl( + BRect(10.0, 10.0, 180.0, 40.0), + "holder-probe", + "probe", + None, + 0, + 0, +) + +window.AddChild(control, None) +window.Quit() + +del control +gc.collect() + +del window +del application +gc.collect() + +print("BCONTROL HOLDER OWNERSHIP REGRESSION TEST: PASS")