468,257 Members | 1,423 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

wxPython / styles and marks in TextCtrl

I asked a similar question already in the wxPython mailing list,
but did not get an answer up to now:

1.) When using a TextCtrl with styles (color etc.) in wxPython,
is it then possible to get a 'list' (or anything) from the widget
which tells you which styles are used in the widget (and where!;
'beginning of style', 'end of style', 'type of style' ...)?

2.) Is it possible to set something like a mark in a TextCtrl?

(E.g.: Suppose you put the sentence 'Hello World!' into the
TextCtrl and mark the character 'W' of the word 'World';
now, if the text in the TextCtrl changes, it should be possible
to get the new position of the character 'W' from that mark.)

I think, both should be possible, but I did not see it in the
documentation; maybe I missed something elementary?

Thanks in advance for any help!

--
mailto: logan@phreaker(NoSpam).net

Jul 18 '05 #1
3 2763
> 1.) When using a TextCtrl with styles (color etc.) in wxPython,
is it then possible to get a 'list' (or anything) from the widget
which tells you which styles are used in the widget (and where!;
'beginning of style', 'end of style', 'type of style' ...)?


I don't see anything like this in the wxTextCtrl docs. You must also check
the docs for the superclasses, but there is nothing: the wxWindow class has
some getters, but they apply to the window, not runs of text.

Probably it would be a good idea to investigate the wxStyledTextCtrl. There
are examples of using it in the wxPython demo program. This control isn't
documented in the main alphabetical list of classes in the version of the
docs I have. Iirc wxStyledTextCtrl is a wrapper for the scintilla classes.

HTH.

Edward
--------------------------------------------------------------------
Edward K. Ream email: ed*******@charter.net
Leo: Literate Editor with Outlines
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------
Jul 18 '05 #2
On Mon, 01 Dec 2003 20:47:38 -0600, Edward K. Ream wrote:
Probably it would be a good idea to investigate the wxStyledTextCtrl. There
are examples of using it in the wxPython demo program. This control isn't
documented in the main alphabetical list of classes in the version of the
docs I have. Iirc wxStyledTextCtrl is a wrapper for the scintilla classes.


Hello Edward; thanks for your answer!

Yes, StyledTextCtrl is a wrapper for Scintilla; the wxPython
documentiation for it can be found here:

http://www.pyframe.com/wxdocs/stc/index.html

But actually, I was looking for something more 'light weight'; e.g.
to write my own Scintilla-like component (which I would not like to
base on Scintilla :-)

Calling Scintilla (STC) the heavy weight champion and TextCtrl an
amateur, I think there is something missing just in between.

L.

--
mailto: logan@phreaker(NoSpam).net

Jul 18 '05 #3
> Yes, StyledTextCtrl is a wrapper for Scintilla; the wxPython
documentation for it can be found here:

http://www.pyframe.com/wxdocs/stc/index.html


Thanks for this link. I'll be using it soon to give a wxPython look to Leo.

Edward
--------------------------------------------------------------------
Edward K. Ream email: ed*******@charter.net
Leo: Literate Editor with Outlines
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by sillyemperor | last post: by
1 post views Thread by PeterG | last post: by
3 posts views Thread by Alejandro | last post: by
4 posts views Thread by Jimmy | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.