wxSTC toggle indic mask

As I saw in the wxPython demo, i used this code to temporary underline some text (for run-time error display):

    ed.StartStyling(836, wxSTC_INDICS_MASK)
    ed.SetStyling(10, wxSTC_INDIC0_MASK)

but now... how to toggle the underlines?

Alessandro Crugnola [aka] sephiroth
Flash | PHP Developer
http://www.sephiroth.it

Team Macromedia Volunteer for Flash
http://www.macromedia.com/go/team

Alessandro Crugnola:

    ed.StartStyling(836, wxSTC_INDICS_MASK)
    ed.SetStyling(10, wxSTC_INDIC0_MASK)

but now... how to toggle the underlines?

     ed.StartStyling(836, wxSTC_INDICS_MASK)
     ed.SetStyling(10, 0)

   Neil

thanks, but didn't work.
the line remains underlined

···

Alessandro Crugnola:

    ed.StartStyling(836, wxSTC_INDICS_MASK)
    ed.SetStyling(10, wxSTC_INDIC0_MASK)

but now... how to toggle the underlines?

    ed.StartStyling(836, wxSTC_INDICS_MASK)
    ed.SetStyling(10, 0)

  Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

Alessandro Crugnola:

thanks, but didn't work.
the line remains underlined

   You may need to turn off layout caching:
ed.SetLayoutCache(0)

   Neil

Alessandro Crugnola:

thanks, but didn't work.
the line remains underlined

  You may need to turn off layout caching:
ed.SetLayoutCache(0)

  Neil

mmhhh... sorry but also with this modify it doesn't work.
Text remains underlined

Alessandro Crugnola:

mmhhh... sorry but also with this modify it doesn't work.
Text remains underlined

   To see this work, in the wxPython/demo/wxStyledTextCtrl_2.py, modify the
PythonSTC class so that __init__ contains after the superclass __init__:

        self.underlineShown = 0
        self.SetLayoutCache(0)

and then in OnMarginClick:

        self.underlineShown = not self.underlineShown
        endStyled = self.GetEndStyled()
        self.StartStyling(19, wxSTC_INDICS_MASK)
        if self.underlineShown:
                self.SetStyling(19, wxSTC_INDIC0_MASK)
        else:
                self.SetStyling(19, 0)
        self.StartStyling(endStyled, 0xff)

run the demo and click in the fold margin to turn the underlining on and
off.

   Neil

:: To see this work, in the
:: wxPython/demo/wxStyledTextCtrl_2.py, modify the PythonSTC
:: class so that __init__ contains after the superclass __init__:
::
:: self.underlineShown = 0
:: self.SetLayoutCache(0)
::
:: and then in OnMarginClick:
::
:: self.underlineShown = not self.underlineShown
:: endStyled = self.GetEndStyled()
:: self.StartStyling(19, wxSTC_INDICS_MASK)
:: if self.underlineShown:
:: self.SetStyling(19, wxSTC_INDIC0_MASK)
:: else:
:: self.SetStyling(19, 0)
:: self.StartStyling(endStyled, 0xff)

thanks, this works fine in the demo wxSTC!
I can't really understand why in my code, the same doesn't ?!?

:: thanks, this works fine in the demo wxSTC!
:: I can't really understand why in my code, the same doesn't ?!?

Sorry, to post again in this thread.. but it has a certain importance for me..

if i set up the code you sent me in the margin click event it works fine also for my application (i can't understand now..)
but the problem is that i don't want to put it in this event, but i would like that when a user click any key on keyboard the
underline text goes away.. so i put the same code inside my onModify handler, but there does not work!...

Alessandro Crugnola:

if i set up the code you sent me in the margin click event it works fine

also for my application (i can't understand now..)

but the problem is that i don't want to put it in this event, but i would

like that when a user click any key on keyboard the

underline text goes away.. so i put the same code inside my onModify

handler, but there does not work!...

   This is correct and documented: no changes can be made in the handler for
the modified notification. You should either use the key notification or
perform the styling as a delayed task after the modification.

   Neil

:: This is correct and documented: no changes can be made in
:: the handler for the modified notification. You should either
:: use the key notification or perform the styling as a delayed
:: task after the modification.

Thanks very much.
Not wokrs fine