PyObject *scribus_setmargins(PyObject* /* self */, PyObject* args) { double lr, tpr, btr, rr; if (!PyArg_ParseTuple(args, "dddd", &lr, &rr, &tpr, &btr)) return nullptr; if (!checkHaveDocument()) return nullptr; MarginStruct margins(ValueToPoint(tpr), ValueToPoint(lr), ValueToPoint(btr), ValueToPoint(rr)); ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc; ScribusView* currentView = ScCore->primaryMainWindow()->view; currentDoc->resetPage(currentDoc->pagePositioning(), &margins); currentView->reformPages(); currentDoc->setModified(true); currentView->GotoPage(currentDoc->currentPageNumber()); currentView->DrawNew(); Py_RETURN_NONE; }