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)
716
716
if (!PyArg_ParseTuple (args, " s" , &title)) {
717
717
return NULL ;
718
718
}
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]];
723
720
Py_RETURN_NONE;
724
721
}
725
722
@@ -946,10 +943,8 @@ -(void)save_figure:(id)sender { gil_call_method(toolbar, "save_figure"); }
946
943
rect.origin .y = 0.5 *(height - rect.size .height );
947
944
948
945
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]];
953
948
NSImage * image = [[NSImage alloc ] initWithContentsOfFile: filename];
954
949
buttons[i] = [[NSButton alloc ] initWithFrame: rect];
955
950
[image setSize: size];
You can’t perform that action at this time.
0 commit comments