472,955 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,955 software developers and data experts.

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 2968
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lo?c Mah? | last post by:
Hello I try to use a Validator for a TxtCtrl placed in a Panel with a Button in order to trigger the Validator and test the content of TxtCtrl. I have looked into wxPython documentation and...
1
by: sillyemperor | last post by:
I was a new guy of Python,when i want to test my wxPython app by unittest,it couldn`t work.I fund a stubmaker.py but it only for wxDialog but all widgets.Can someone can tell me how test wxPython...
1
by: PeterG | last post by:
Hi, I am relatively new to Python, and am learning it as part of a university module... Im currently undertaking a project to create an IM server and IM gui client. I have a very basic...
10
by: abcd | last post by:
I have a TextCtrl which is set to be multi-line. I have a function say, updateText(msg), which takes some string and appends it to the text control... txtControl.AppendText(msg) ...
5
by: citronelu | last post by:
I made a small wxPython app that retrieves web data; for visual logging I use a TextCtrl widget, and stdout is redirected to it, something like this: class RedirectOutput: def __init__(self,...
9
by: Tyler | last post by:
Hello All: I am currently working on a project to create an FEM model for school. I was thinking about using wxPython to gather the 12 input variables from the user, then, after pressing the...
3
by: Alejandro | last post by:
Hi: I want to redirect stdout to a textctrl I have. From what I read in the wxpython documentation, I can use the wxLogTextCtrl class to do this. I am doing the following: class...
1
by: aeroumr | last post by:
In the following code, I have created a panel with a button and a textctrl object on it. I have also created a menubar that will create a new text file (i.e. textctrl object). My problem is that...
4
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.