开发者

Horizontal scrolling in a wx.RichTextCtrl

I have a RichTextCtrl created as follows:

self.userlist = wx.richtext.RichTextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)

It all wo开发者_运维问答rks fine, except for the wx.HSCROLL style. If I change the RichTextCtrl to a regular TextCtrl, it correctly horizontal scrolls on long lines, rather than wrapping, but on the RichTextCtrl it wraps regardless. Is there an easy way to make it scroll horizontally? (I do, unfortunately, need the RichTextCtrl's featureset for this object.)


sorry, I can't post this as a comment as I don't have the reputation, and I'm not sure this is an answer per se

http://trac.wxwidgets.org/ticket/9382 it looks old, but I confirm the behaviour you are seeing.

Does setting the wx.TE_RICH or wx.TE_RICH2 on a regular TextCtrl give you the behaviour you need?


This is a bug in wxRitchText see http://trac.wxwidgets.org/ticket/9382

Also instead of wx.TE_MULTILINE|wx.TE_READONLY you should be using values from richtext module i.e. wx.richtext.RE_MULTILINE |wx.richtext.RE_READONLY, though that doesn't make any difference, still.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜