Newbie: pywin problem

Neil Hodgson nhodgson at bigpond.net.au
Mon Aug 2 19:34:57 EDT 2004


Martin DeMello:

> >>> template = pywin.mfc.docview.DocTemplate(None)
> >>> doc = pywin.scintilla.document.CScintillaDocument(template)
> >>> view = pywin.scintilla.view.CScintillaView(doc)
> >>> fr = win32ui.GetMainFrame()
> >>> view.CreateWindow(fr)
>
> Now how do I get the window to display? I thought the call to
> CreateWindow would do it, but the window just gets created silently.

   The template stuff is quite complex and I never understand it apart from
when I've had to work with it recently. And its been a couple of years. By
the end of your code you actually have a zero sized view window which is a
direct child of the application frame rather than being inside an MDI
window. If you open a file it will go into this view which will spread out
over the app and not be properly clipped. I'm not sure what you want to
achieve. If it is just opening another window within the environment from
code, calling something in the template would be better. The "Python
Programming on Win32" book gives an example of adding a new document type
and view to PythonWin. There is a mailing list for Win32 Python issues at
http://mail.python.org/mailman/listinfo/python-win32

   Neil





More information about the Python-list mailing list