View unanswered posts | View active topics It is currently 2020-05-26 6:45



This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
 关于Network 添加节点问题 
Author Message
新手上路

Joined: 2014-09-04 15:38
Posts: 1
Post 关于Network 添加节点问题
我在network里添加 用循环添加node
for(int i = 0; i < 5; i++)
{
Node n = new Node();
node.location ....
node.image ...
node.name ...

network.elementBox.add(n);
Thead.sleep(1000);

}

我想node 是一个个添加,每个之间停1s, 但结果是过了5s,node一起显示出来了
不知道为什么
我network加在elementHost.child = network
elementHost在winform一个panel上
我就是想network添加node一个一个添加,有个过程可以看到


2014-09-04 15:49
Profile
TWaver开发组
User avatar

Joined: 2009-04-20 18:37
Posts: 3115
Post Re: 关于Network 添加节点问题
Thead.sleep(1000);
如果是在事件派发线程里调用,就会出现您说的情况。

这种情况您应该起个timer,参考MatrixDemo。


2014-09-04 16:21
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron