File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -716,10 +716,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
716716 if (!PyArg_ParseTuple (args, " s" , &title)) {
717717 return NULL ;
718718 }
719- NSString * ns_title = [[NSString alloc ]
720- initWithCString: title
721- encoding: NSUTF8StringEncoding];
722- [self ->window setTitle: ns_title];
719+ [self ->window setTitle: [NSString stringWithUTF8String: title]];
723720 Py_RETURN_NONE;
724721}
725722
@@ -946,10 +943,8 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
946943 rect.origin .y = 0.5 *(height - rect.size .height );
947944
948945 for (int i = 0 ; i < 7 ; i++) {
949- NSString * filename = [NSString stringWithCString: images[i]
950- encoding: NSUTF8StringEncoding];
951- NSString * tooltip = [NSString stringWithCString: tooltips[i]
952- encoding: NSUTF8StringEncoding];
946+ NSString * filename = [NSString stringWithUTF8String: images[i]];
947+ NSString * tooltip = [NSString stringWithUTF8String: tooltips[i]];
953948 NSImage * image = [[NSImage alloc ] initWithContentsOfFile: filename];
954949 buttons[i] = [[NSButton alloc ] initWithFrame: rect];
955950 [image setSize: size];
You can’t perform that action at this time.
0 commit comments