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

Skip to content

updated gtk backend #24015

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

Closed
wants to merge 1 commit into from
Closed

updated gtk backend #24015

wants to merge 1 commit into from

Conversation

mablue
Copy link

@mablue mablue commented Sep 27, 2022

for fixing this error:

  File "/home/mab/.local/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py", line 236, in resize
    toolbar_size = self.toolbar.size_request()
AttributeError: 'NavigationToolbar2GTK4' object has no attribute 'size_request'. Did you mean: 'get_size_request'?

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

for fixing this error:
```
  File "/home/mab/.local/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py", line 236, in resize
    toolbar_size = self.toolbar.size_request()
AttributeError: 'NavigationToolbar2GTK4' object has no attribute 'size_request'. Did you mean: 'get_size_request'?
```
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@QuLogic
Copy link
Member

QuLogic commented Sep 29, 2022

I see that this does fix the crash of Figure.set_size_inches on GTK4, but it doesn't seem correct. In GTK3, size_request() returned the height of the toolbar as 42, but using get_size_request(), it returns -1. And GTK4 also returns -1.

QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Sep 29, 2022
Using the same method as __init__ to avoid the deprecated-in-GTK3 and
removed-in-GTK4 API.

Closes matplotlib#24015
@QuLogic
Copy link
Member

QuLogic commented Sep 30, 2022

Thank you for your PR @mablue; sorry it did not get merged. But I believe we did manage to fix the issue you were seeing.

@mablue
Copy link
Author

mablue commented Sep 30, 2022

Ok thank you too 😑🥲🤣

@tacaswell tacaswell added this to the unassigned milestone Sep 30, 2022
melissawm pushed a commit to melissawm/matplotlib that referenced this pull request Dec 19, 2022
Using the same method as __init__ to avoid the deprecated-in-GTK3 and
removed-in-GTK4 API.

Closes matplotlib#24015
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