Re: [Python.NET] implement the interface of IWin32Window

by searching pythondotnet mailing-list archive, I just found the following message, http://www.mail-archive.com/pythondotnet@python.org/msg00094.html I think what I mentioned in the email is wrong, and the only solution is implement the interface in a .NET assembly and expose it to PythonDotNet. PythonDotNet just works as a BRIDGE, which gives access to .Net platform. Thanks, On Thu, Jul 31, 2008 at 3:00 AM, <pythondotnet-request@python.org> wrote:
Send PythonDotNet mailing list submissions to pythondotnet@python.org
To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/pythondotnet or, via email, send a message with subject or body 'help' to pythondotnet-request@python.org
You can reach the person managing the list at pythondotnet-owner@python.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of PythonDotNet digest..."
Today's Topics:
1. implement System.Windows.Forms.IWin32Window (H.N.(HARRY) ZHANG) 2. function assignment (Fulop David)
----------------------------------------------------------------------
Message: 1 Date: Wed, 23 Jul 2008 13:57:36 -0700 From: "H.N.(HARRY) ZHANG" <hnzhang@gmail.com> Subject: [Python.NET] implement System.Windows.Forms.IWin32Window To: pythondotnet@python.org Message-ID: <958f31170807231357q489402bfy509e2ef058a5370d@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1"
I'm trying to implement the interface of IWin32Window, so that when the UI from PythonDotNet is created, I can set the owner.
Here is the code,
class WindowWrapper(System.Windows.Forms.IWin32Window): def __init__(self, handle): self._hwnd = handle
def Handle(): doc = "property foo's doc string" def fget(self): return self._hwnd return locals() Handle = property(**Handle())
However, when an instance of WindowWrapper gets created, I got the following error---# TypeError: object does not implement IWin32Window #
Here is the code to create an instance of WindowWrapper procs = System.Diagnostics.Process.GetProcessesByName("maya"); intPtr = procs[0].MainWindowHandle self.winWrapper = WindowWrapper(intPtr)
It seems I am doing something wrong in class WindowWrapper...
participants (1)
-
H.N.(HARRY) ZHANG