Skip to content
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

Cannot create wx.GraphicsContext from wx.msw.MetafileDC #811

Closed
DietmarSchwertberger opened this issue Apr 8, 2018 · 2 comments
Closed

Comments

@DietmarSchwertberger
Copy link
Contributor

Operating system: Windows 10
wxPython version: 4.0.1
Stock or custom build: Stock
Python version: 3.6, 64 bit
Stock or custom build: stock

Description of the problem:
GraphicsContext.Create does not accept a MetafileDC as argument. Classic did.

>>> import wx, wx.msw
>>> app = wx.App()
>>> dc = wx.msw.MetafileDC()
>>> gc = wx.GraphicsContext.Create(dc)
Traceback (most recent call last):
  Python Shell, prompt 9, line 1
builtins.TypeError: GraphicsContext.Create(): arguments did not match any overloaded call:
  overload 1: argument 1 has unexpected type 'MetafileDC'
  overload 2: argument 1 has unexpected type 'MetafileDC'
  overload 3: argument 1 has unexpected type 'MetafileDC'
  overload 4: argument 1 has unexpected type 'MetafileDC'
  overload 5: argument 1 has unexpected type 'MetafileDC'
  overload 6: too many arguments

The Classic code:

>>> import wx
>>> app = wx.App()
>>> dc = wx.MetaFileDC()
>>> gc = wx.GraphicsContext_Create(dc)
RobinD42 added a commit to RobinD42/Phoenix that referenced this issue May 6, 2018
@RobinD42
Copy link
Member

RobinD42 commented May 6, 2018

Fixed by #845

@RobinD42 RobinD42 closed this as completed May 6, 2018
@DietmarSchwertberger
Copy link
Contributor Author

@RobinD42 : thanks a lot. I have now a prototype of an EMF backend for matplotlib running. It's working well, including clipping.

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

No branches or pull requests

2 participants