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

Skip to content

Fix Qt canvas resize_event #1585

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
Jan 16, 2013
Merged

Fix Qt canvas resize_event #1585

merged 1 commit into from
Jan 16, 2013

Conversation

tonysyu
Copy link
Contributor

@tonysyu tonysyu commented Dec 11, 2012

The Qt backend doesn't fire resize_event when resizing so callbacks connected to the event never get called. The following example should print when the figure is resized:

import matplotlib as mpl
mpl.use('Qt4Agg')
import matplotlib.pyplot as plt

def printer(event):
    print('callback')

fig = plt.figure()
fig.canvas.mpl_connect('resize_event', printer)
plt.show()

This PR just adds a call to resize_event. (Some slight refactoring also wandered into the commit.)

@pelson
Copy link
Member

pelson commented Dec 11, 2012

👍 good work @tonysyu.

@mdboom
Copy link
Member

mdboom commented Jan 16, 2013

Merging (and backporting to v1.2.x)

mdboom added a commit that referenced this pull request Jan 16, 2013
@mdboom mdboom merged commit 80a406c into matplotlib:master Jan 16, 2013
mdboom added a commit that referenced this pull request Jan 16, 2013
@tacaswell
Copy link
Member

This was cherry-picked as f6fcb39

(tracked it down, might as well record it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants