-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Add icon to macosx backend #14851
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
Add icon to macosx backend #14851
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next thing is to work out how to get this absolute path properly instead of hardcoding it for my laptop! Does anyone have any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps something like (untested)
PyObject* mpl = NULL, * data_path_str = NULL, * data_path_bytes = NULL; char* data_path; if (!(mpl = PyImport_ImportModule("matplotlib")) || !(data_path_str = PyObject_CallMethod(mpl, "get_data_path", NULL)) || !(data_path_bytes = PyUnicode_EncodeFSDefault(data_path_str)) || !(data_path = PyBytes_AsString(data_path_bytes))) { goto exit; } // at that point data_path contains everything up to mpl-data, // then you need to concatenate whatever e.g. with strcat. exit: Py_XDECREF(mpl); Py_XDECREF(data_path_str); Py_XDECREF(data_path_bytes);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not pass it in somehow, like done with navigation toolbar icons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking as request changes to make sure the hard-coded path does not get merged!
I think this will be superseeded by #14930
Going to close in favour of #14930.
Will fix #14850.