File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -810,6 +810,22 @@ static CGFloat _get_device_scale(CGContextRef cr)
810
810
}
811
811
}
812
812
813
+ static PyObject*
814
+ FigureManager_resize (FigureManager* self, PyObject *args, PyObject *kwds)
815
+ {
816
+ int width, height;
817
+ if (!PyArg_ParseTuple (args, " ii" , &width, &height)) {
818
+ return NULL ;
819
+ }
820
+ Window* window = self->window ;
821
+ if (window)
822
+ {
823
+ // 36 comes from hard-coded size of toolbar later in code
824
+ [window setContentSize: NSMakeSize (width, height + 36 .)];
825
+ }
826
+ Py_RETURN_NONE;
827
+ }
828
+
813
829
static PyMethodDef FigureManager_methods[] = {
814
830
{" show" ,
815
831
(PyCFunction)FigureManager_show,
@@ -831,6 +847,11 @@ static CGFloat _get_device_scale(CGContextRef cr)
831
847
METH_NOARGS,
832
848
" Returns the title of the window associated with the figure manager."
833
849
},
850
+ {" resize" ,
851
+ (PyCFunction)FigureManager_resize,
852
+ METH_VARARGS,
853
+ " Resize the window (in pixels)."
854
+ },
834
855
{NULL } /* Sentinel */
835
856
};
836
857
You can’t perform that action at this time.
0 commit comments