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

Hannes Grund hgrund at gmx.de
Wed Aug 4 10:46:09 CEST 2004


Thanks for reply,

Sorry for posting incomplete information, 
the options passed to wxTextCtrl determine the the version of the used
RichEdit.dll and (according to the sources) the window class string.
(I don't know anything about the mechanism how pythonwin recognizes which of
its classes to instanciate, maybe this is my problem).
The use of wxTE_RICH option causes the window class string to be "RICHEDIT",
when using the option wxTE_RICH2 the window class string will be
"RichEdit20".

I considered to do it via SendMessage, but on one hand some 
options cannot be set after the creation of the control (and I have to 
create within wx), I tried to construct the EditStreamCallback functions
manually by using struct and array but I simply failed 
(anybody out there with an pointer to an working example ??)

Thanks in advance,

  Hannes Grund



> I'm afraid I don't know what a "RICH2" control is exactly, and why
> Pythonwin
> doesn't know about it.  However, you should also keep in mind that the
> win32gui module should allow you to send whatever Windows messages you
> like.
> SendMessage in win32gui allows you to pass strings and buffers for these
> params, meaning the struct or array modules can be used to pack the raw
> data.  Not as "nice" as the pythonwin OO framework, but should still work.
> 
> Mark.
> 
> > -----Original Message-----
> > From: python-win32-bounces at python.org
> > [mailto:python-win32-bounces at python.org]On Behalf Of Hannes Grund
> > Sent: Tuesday, 3 August 2004 7:23 PM
> > To: python-win32 at python.org
> > Subject: [python-win32] wxPython/Pythonwin interplay/Richtext Controls
> >
> >
> > 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
> >
> > _______________________________________________
> > Python-win32 mailing list
> > Python-win32 at python.org
> > http://mail.python.org/mailman/listinfo/python-win32
> 

-- 
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