Topic: 为什么不会刷新?

  Print this page

1.为什么不会刷新? Copy to clipboard
Posted by: levin
Posted on: 2004-05-02 18:14

利用程序向Composite动态加入组件(表格、按钮等),系统不会刷新,而当我改变窗口大小的时间其会自动刷新,如何让其自动刷新呢?

2.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: floater
Posted on: 2004-05-03 22:28

two ways:
1. repaint(); // brutal force method

2. a better way:
revalidate the changed component
validate its parent.

3.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: levin
Posted on: 2004-05-04 08:34

Sorry,我没说明,这是SWT的问题,烦高手再指点迷津!

4.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: Jove
Posted on: 2004-05-04 09:53

levin wrote:
Sorry,我没说明,这是SWT的问题,烦高手再指点迷津!


本版有篇帖子"[SWT求助]怎么动态在composite里加widget" 和你一样的问题,你应该发问前先搜一下

5.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: levin
Posted on: 2004-05-07 16:18

Thank you jove,你真是高手!

6.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: levin
Posted on: 2004-05-07 16:25

Jove,OLE FRAME出现这样的问题怎么解决?

7.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: yidengjiang
Posted on: 2004-05-10 13:59

给源程序
大家一起调试

8.Re:为什么不会刷新? [Re: levin] Copy to clipboard
Posted by: vitosun
Posted on: 2004-05-21 13:49

可以这样:
if ((panel != null) && (!panel.isDisposed())) {
      panel.dispose();
    }
    panel = new Composite(shell,SWT.NONE);
    panel.setLayoutData(new GridData(GridData.FILL_BOTH));

.....

shell.layout(true);

9.Re:为什么不会刷新?? [Re: levin] Copy to clipboard
Posted by: vitosun
Posted on: 2004-05-21 13:52

在每次要刷新的时候执行省略号之前的代码,
实现自己的功能之后,一定要layoout shell


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923