wxpython textctrl内容刷新_wxPython TextCtrl - 奇怪的滚动行为

I have a TextCtrl which is set to be multi-line. I have a function

say, updateText(msg), which takes some string and appends it to the

text control...

txtControl.AppendText(msg)

.....however, if the text that I am appending would cause the scroll

bars to appear/or scroll since the text is long the textcontrol appears

to be blank, until you click on the scroll bar...then the text appears.

Any ideas? is this is a sizer problem or a TextCtrl issue??

thanks

解决方案abcd wrote:

I have a TextCtrl which is set to be multi-line. I have a function

say, updateText(msg), which takes some string and appends it to the

text control...

txtControl.AppendText(msg)

....however, if the text that I am appending would cause the scroll

bars to appear/or scroll since the text is long the textcontrol appears

to be blank, until you click on the scroll bar...then the text appears.

Any ideas? is this is a sizer problem or a TextCtrl issue??

thanks

Don''t know for sure, but you can try calling the Refresh() method on the

text control and see if that fixes it.

On Oct 30, 2:52 pm, John Salerno

Don''t know for sure, but you can try calling the Refresh() method on

the

text control and see if that fixes it.

Didn''t make a difference. Not sure what the problem is, I am wondering

if it is a layout issue since that is my weak spot with wxPython.

sizerTextPanel =

wx.StaticBoxSizer(self.sizerTextPanel_staticbox, wx.HORIZONTAL)

sizerTextPanel .Add(self.textPane, 1, wx.ALL|wx.EXPAND, 2)

self.textPanel.SetAutoLayout(True)

self.textPanel.SetSizer(sizerTextPanel )

sizerTextPanel .Fit(self.textPanel)

sizerTextPanel .SetSizeHints(self.textPanel)

sizerMainPanel.Add(self.textPanel, 3, wx.ALL|wx.EXPAND, 0)

not sure if that means anything to anyone :)

abcd wrote:

sizerMainPanel.Add(self.textPanel, 3, wx.ALL|wx.EXPAND, 0)

Your best bet may be to post to wx************@lists.wxwidgets.org

But one question that comes to mind is, do you not add sizerTextPanel to

sizerMainPanel? I think all sub-sizers should be added to the main

sizer, unless there''s some weird reason I don''t know of.

If you post to the wxPython mailing list, you might want to include more

of your code so we can see the bigger picture.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值