展开/折叠树后的火灾事件 [英] Fire event after expand/collapse tree

查看:55
本文介绍了展开/折叠树后的火灾事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在折叠和展开后触发事件调整大小.当我尝试使用 SWT.Collapse 和 SWT.Expand 做到这一点时,树上没有任何变化,因为它在发生之前就火了.有什么办法吗?

I need to fire event resize after collapse and expand. When I try to do that using SWT.Collapse and SWT.Expand, there is no changes on tree because its fire before its happen. Is there any way to this?

推荐答案

尝试调用 Display.asyncExec 来安排 SWT.Collapse/Expand 中的 Runnable 监听器.Runnable 在当前 Tree 操作完成之前不会运行.

Try calling Display.asyncExec to schedule a Runnable in the SWT.Collapse/Expand listener. The Runnable will not run until the current Tree operation is complete.

这篇关于展开/折叠树后的火灾事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆