如何模仿事件? [英] howto emulate events?

查看:103
本文介绍了如何模仿事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写A.I.对于逻辑游戏,我需要知道如何调用这样的方法:

展开 | 选择 | Wrap | 行号

解决方案

它只是一个函数,称之为任何其他功能。


如果你有:

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


对于消息框的事情,我建议你自己创建一个类来处理消息框。类似于...

展开 | 选择 | Wrap | 行号



这意味着,以某种方式确定是否已弹出消息框,并以可编程方式关闭它。



''确定*如果*已打开消息框'是什么意思?这是你的代码。如果你告诉它打开它会打开。没有很多确定是否关于它。或者您是否试图从另一个不属于您自己的程序关闭消息框?


Gary正确地制作了自己的MessageBox类。我会添加他的建议......包括一个计时器和一个.Close()方法。这样你就可以给它一个外部的Close()命令,如果没有人在10秒内响应,它就会自动关闭。


I''m writing A.I. for logic game, and I need to know how do I call methods like this:

Expand|Select|Wrap|Line Numbers

解决方案

Its just a function, call it like any other function.

If you have:

Expand|Select|Wrap|Line Numbers


For the message box thing, I''d recommend making your own class to handle showing a message box. Something like...

Expand|Select|Wrap|Line Numbers


That means, somehow to determine if messagebox has popped up, and close it programmably.

What do you mean by ''determine *if* a messagebox has opened"? It''s your code. It opens if you tell it to open. There isn''t a lot of "determine if" about it. Or are you trying to close a messagebox from another program not your own?

Gary is right about making your own MessageBox class. I would add to his suggestion with this... Include a timer as well as a .Close() method. That way you can give it an external Close() command, as well has have it close itself if nobody responds in 10 seconds.


这篇关于如何模仿事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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