@@ -803,6 +803,7 @@ static int _get_snap(GraphicsContext* self, enum e_snap_mode* mode)
803803 self->color [0 ] = r;
804804 self->color [1 ] = g;
805805 self->color [2 ] = b;
806+ self->color [3 ] = 1.0 ;
806807
807808 Py_INCREF (Py_None);
808809 return Py_None;
@@ -2279,7 +2280,7 @@ static CGRect _find_enclosing_rect(CGPoint points[3])
22792280 {" Arial" , 14 },
22802281 {" Helvetica" , 15 },
22812282 {" Avant Garde" , 16 },
2282- {" sans-serif" , 10 },
2283+ {" sans-serif" , 15 },
22832284 {" Apple Chancery" , 17 },
22842285 {" Textile" , 18 },
22852286 {" Zapf Chancery" , 19 },
@@ -2364,8 +2365,8 @@ static CGRect _find_enclosing_rect(CGPoint points[3])
23642365 " Arial-BoldItalicMT" },
23652366 {" Helvetica" , /* 15 */
23662367 " Helvetica-Bold" ,
2367- " " ,
2368- " " },
2368+ " Arial-ItalicMT " ,
2369+ " Arial-BoldItalicMT " },
23692370 {" AvantGardeITC-Book" , /* 16 */
23702371 " AvantGardeITC-Demi" ,
23712372 " AvantGardeITC-BookOblique" ,
@@ -2681,7 +2682,6 @@ static CGRect _find_enclosing_rect(CGPoint points[3])
26812682 PyErr_SetString (PyExc_RuntimeError, " CGContextRef is NULL" );
26822683 return NULL ;
26832684 }
2684-
26852685 if (!PyArg_ParseTuple (args, " ffu#Ofssf" ,
26862686 &x,
26872687 &y,
@@ -3755,7 +3755,6 @@ static void _data_provider_release(void* info, const void* data, size_t size)
37553755 [window setDelegate: view];
37563756 [window makeFirstResponder: view];
37573757 [[window contentView ] addSubview: view];
3758- [window makeKeyAndOrderFront: nil ];
37593758
37603759 nwin++;
37613760
@@ -3788,6 +3787,20 @@ static void _data_provider_release(void* info, const void* data, size_t size)
37883787 Py_TYPE (self)->tp_free ((PyObject*)self);
37893788}
37903789
3790+ static PyObject*
3791+ FigureManager_show (FigureManager* self)
3792+ {
3793+ Window* window = self->window ;
3794+ if (window)
3795+ {
3796+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc ] init ];
3797+ [window makeKeyAndOrderFront: nil ];
3798+ [pool release ];
3799+ }
3800+ Py_INCREF (Py_None);
3801+ return Py_None;
3802+ }
3803+
37913804static PyObject*
37923805FigureManager_destroy (FigureManager* self)
37933806{
@@ -3804,6 +3817,11 @@ static void _data_provider_release(void* info, const void* data, size_t size)
38043817}
38053818
38063819static PyMethodDef FigureManager_methods[] = {
3820+ {" show" ,
3821+ (PyCFunction)FigureManager_show,
3822+ METH_NOARGS,
3823+ " Shows the window associated with the figure manager."
3824+ },
38073825 {" destroy" ,
38083826 (PyCFunction)FigureManager_destroy,
38093827 METH_NOARGS,
@@ -4662,7 +4680,9 @@ -(void)save_figure:(id)sender
46624680 NSText * messagebox = [[NSText alloc ] initWithFrame: rect];
46634681 [messagebox setFont: font];
46644682 [messagebox setDrawsBackground: NO ];
4665- [messagebox setEditable: NO ];
4683+ [messagebox setSelectable: NO ];
4684+ /* if selectable, the messagebox can become first responder,
4685+ * which is not supposed to happen */
46664686 rect = [messagebox frame ];
46674687 rect.origin .y = 0.5 * (height - rect.size .height );
46684688 [messagebox setFrameOrigin: rect.origin];
0 commit comments