Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace tabs with spaces in C code. #22370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/_macosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
FigureManager_set_icon(PyObject* null, PyObject* args) {
PyObject* icon_path;
if (!PyArg_ParseTuple(args, "O&", &PyUnicode_FSDecoder, &icon_path)) {
return NULL;
return NULL;
}
const char* icon_path_ptr = PyUnicode_AsUTF8(icon_path);
if (!icon_path_ptr) {
Expand All @@ -653,7 +653,7 @@ static CGFloat _get_device_scale(CGContextRef cr)
}
@autoreleasepool {
NSString* ns_icon_path = [NSString stringWithUTF8String: icon_path_ptr];
Py_DECREF(icon_path);
Py_DECREF(icon_path);
if (!ns_icon_path) {
PyErr_SetString(PyExc_RuntimeError, "Could not convert to NSString*");
return NULL;
Expand All @@ -667,14 +667,14 @@ static CGFloat _get_device_scale(CGContextRef cr)
PyErr_SetString(PyExc_RuntimeError, "Image is not valid");
return NULL;
}
@try {
NSApplication* app = [NSApplication sharedApplication];
app.applicationIconImage = image;
}
@catch (NSException* exception) {
PyErr_SetString(PyExc_RuntimeError, exception.reason.UTF8String);
return NULL;
}
@try {
NSApplication* app = [NSApplication sharedApplication];
app.applicationIconImage = image;
}
@catch (NSException* exception) {
PyErr_SetString(PyExc_RuntimeError, exception.reason.UTF8String);
return NULL;
}
}
Py_RETURN_NONE;
}
Expand Down Expand Up @@ -740,10 +740,10 @@ static CGFloat _get_device_scale(CGContextRef cr)
{"destroy",
(PyCFunction)FigureManager_destroy,
METH_NOARGS},
{"set_icon",
(PyCFunction)FigureManager_set_icon,
METH_STATIC | METH_VARARGS,
"Set application icon"},
{"set_icon",
(PyCFunction)FigureManager_set_icon,
METH_STATIC | METH_VARARGS,
"Set application icon"},
{"set_window_title",
(PyCFunction)FigureManager_set_window_title,
METH_VARARGS},
Expand Down
4 changes: 2 additions & 2 deletions src/_tkmini.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ typedef struct Tk_PhotoImageBlock
int offset[4];
} Tk_PhotoImageBlock;

#define TK_PHOTO_COMPOSITE_OVERLAY 0 // apply transparency rules pixel-wise
#define TK_PHOTO_COMPOSITE_SET 1 // set image buffer directly
#define TK_PHOTO_COMPOSITE_OVERLAY 0 // apply transparency rules pixel-wise
#define TK_PHOTO_COMPOSITE_SET 1 // set image buffer directly
#define TCL_OK 0
#define TCL_ERROR 1

Expand Down