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

Skip to content

Inline wx icon loading. #15214

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
Apr 14, 2020
Merged

Inline wx icon loading. #15214

merged 1 commit into from
Apr 14, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 7, 2019

No other backend bothers checking that the icons actually exist -- them
not being present would be a packaging bug anyways.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added the GUI: wx label Sep 7, 2019
@tacaswell tacaswell added this to the v3.3.0 milestone Sep 7, 2019
@QuLogic
Copy link
Member

QuLogic commented Sep 8, 2019

Could this check be because wx.Bitmap crashes (in C, outside the interpreter) with an invalid path?

@DietmarSchwertberger

@anntzer
Copy link
Contributor Author

anntzer commented Sep 9, 2019

It doesn't, you get an exception in Python (not in wx.Bitmap(), which just returns an object with IsOk() == False, but later when trying to add it to the toolbar) and a nice error window.

@timhoffm
Copy link
Member

Note that the qt5 backend has nowadays a similar methd icon() In particular this handles color conversion of icons for dark themes, which is not yet implemented in the wx backend.

Note that for easily checking dark theme we need wx.SystemAppearance which will only become available in the yet to be released wx 4.1.

I'm therefore inclined towards keeping the method.

No other backend bothers checking that the icons actually exist -- them
not being present would be a packaging bug anyways.
@anntzer
Copy link
Contributor Author

anntzer commented Apr 13, 2020

Fair enough, changed this to just strip out redundant error checking (per above).

@QuLogic QuLogic merged commit b160322 into matplotlib:master Apr 14, 2020
@anntzer anntzer deleted the wxicons branch April 14, 2020 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants