473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2991
> 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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.