We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a78fa45 commit b7c9694Copy full SHA for b7c9694
bindings/interface/TextView.cpp
@@ -233,7 +233,12 @@ py::class_<BTextView, PyBTextView, BView, std::unique_ptr<BTextView,py::nodelete
233
.def("Delete", py::overload_cast<int32, int32>(&BTextView::Delete), "", py::arg("startOffset"), py::arg("endOffset"))
234
.def("Text", &BTextView::Text, "")
235
.def("TextLength", &BTextView::TextLength, "")
236
-.def("GetText", &BTextView::GetText, "", py::arg("offset"), py::arg("length"), py::arg("buffer"))
+//.def("GetText", &BTextView::GetText, "", py::arg("offset"), py::arg("length"), py::arg("buffer"))
237
+.def("GetText", [](BTextView& self,int32 offset,int32 length) {
238
+ std::vector<char> buffer(length);
239
+ self.GetText(offset, length, buffer.data());
240
+ return std::string(buffer.data(), length);
241
+}, "", py::arg("offset"), py::arg("length"))
242
.def("ByteAt", &BTextView::ByteAt, "", py::arg("offset"))
243
.def("CountLines", &BTextView::CountLines, "")
244
.def("CurrentLine", &BTextView::CurrentLine, "")
0 commit comments