wxPython / styles and marks in TextCtrl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Logan

    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

  • Edward K. Ream

    #2
    Re: wxPython / styles and marks in TextCtrl

    > 1.) When using a TextCtrl with styles (color etc.) in wxPython,[color=blue]
    > 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' ...)?[/color]

    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 wxStyledTextCtr l. 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 wxStyledTextCtr l is a wrapper for the scintilla classes.

    HTH.

    Edward
    --------------------------------------------------------------------
    Edward K. Ream email: edreamleo@chart er.net
    Leo: Literate Editor with Outlines
    Leo: http://webpages.charter.net/edreamleo/front.html
    --------------------------------------------------------------------


    Comment

    • Logan

      #3
      Re: wxPython / styles and marks in TextCtrl

      On Mon, 01 Dec 2003 20:47:38 -0600, Edward K. Ream wrote:
      [color=blue]
      > Probably it would be a good idea to investigate the wxStyledTextCtr l. 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 wxStyledTextCtr l is a wrapper for the scintilla classes.[/color]

      Hello Edward; thanks for your answer!

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



      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

      Comment

      • Edward K. Ream

        #4
        Re: wxPython / styles and marks in TextCtrl

        > Yes, StyledTextCtrl is a wrapper for Scintilla; the wxPython[color=blue]
        > documentation for it can be found here:
        >
        > http://www.pyframe.com/wxdocs/stc/index.html[/color]

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

        Edward
        --------------------------------------------------------------------
        Edward K. Ream email: edreamleo@chart er.net
        Leo: Literate Editor with Outlines
        Leo: http://webpages.charter.net/edreamleo/front.html
        --------------------------------------------------------------------


        Comment

        Working...