Pregunta

I know how to add line numbers to a wxPython StyledTextCtrl, thanks to the wxPython Demos.

myctrl.SetMarginType(0, wx.stc.STC_MARGIN_NUMBER)

Is there a way to make the line numbering start at something other than 1?

The motivation for this is to show snippets of a large text file. I want the line numbers to match those in the complete file, but I don't want to load the entire file in my text control.

¿Fue útil?

Solución 2

Perhaps this could be achieved by folding the content you don't wish to display. More information can be located here: http://www.yellowbrain.com/stc/folding.html

Otros consejos

I'd hide the default line number margin and use a custom one, see margins documentation for the details.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top