我找到了SetMarginBackground
...但是无法使用...我是wxPython
的新手。我需要在我创建的StyledTextCtrl
类中使用它……在此先感谢...
以下代码在折叠保证金下工作正常...
self.SetFoldMarginHiColour(True, "#282828")
self.SetFoldMarginColour(True, "#282828")
我也需要更改边距背景颜色...请帮助我..谢谢..
wx.stc.StyledTextCtrl是“原始” scintilla界面的1对1映射,其文档可以在Scintilla网站(http://www.scintilla.org/)中找到。
更改Scintilla
中的页边距颜色-“处理页边距的方式(尤其是涉及到颜色的方法)非常难以理解”。有关详细信息,说明和链接,请参见https://github.com/jacobslusser/ScintillaNET/issues/220:激怒的@jacobslusser
最后,我设法从众多来源中整理了一个例子:
ed
是wx.stc.StyledTextCtrl
的地方>
# line numbers in the margin
ed.SetMarginType(1, stc.STC_MARGIN_NUMBER)
ed.SetMarginWidth(1, 25)
# Background and foreground colours
ed.StyleSetSpec(stc.STC_STYLE_DEFAULT,'fore:#000000,back:#00A100')
# Line numbers in margin colours
ed.StyleSetSpec(wx.stc.STC_STYLE_LINENUMBER,'fore:#FFFF00,back:#0000AA')
我只能建议您使用它。