wxPython / styles and marks in TextCtrl

L

Logan

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

Edward K. Ream

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
 
L

Logan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top