[python-win32] wxPython/Pythonwin interplay/Richtext Controls

Hannes Grund hgrund at gmx.de
Tue Aug 3 11:23:23 CEST 2004


Dear all, 

The original problem I had was the need of an richtext control 
to be used within a wxWidgets/wxPython gui running on an MSWin platform.
wxTextCtrl as provided by wxWidgets uses (internally) the richtext 
ctrl (as provided by MSW), however, it exposes not its rich text 
capabilities (simply due to the platform specific nature) within 
the wxPython framework, there is one option to set (wxTE_RICH, wxTE_RICH2),
precisly the version
of the underlying rich edit dll to use, the use of this option 
affects also the window class set by wxWidgets.

The following works well,

textctrl = wxTextCtrl(parent,-1,"",style=wxTE_RICH)
pywnd = win32ui.CreateWindowFromHandle(textctrl.GetHandle())

The resulting pywin object is of type PyCRichEditCtrl, consquently, any 
rich text specific features can be accessed. 

The problem is that want to use some features only available by using the
wxTE_RICH2 option (in the code example above wxTE_RICH is used.) 
The above construction refuses to work then, the resulting pythonwin object
is only a PyCWnd object, the rich text api is not accessible.

My question is now, if there is any way to force the creation of an
PyCRichEditCtrl instance from an given handle.

Thanks in advance,

  Hannes Grund

-- 
NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl



More information about the Python-win32 mailing list