Essentially, the strategy is to create a bunch of widgets with callbacks, then enter a main event loop.
本质上,这个策略是创建带回调的一串窗口小部件,然后进入一个主事件循环。
Listing 5 shows the remainder of the main logic loop.
清单5显示了主逻辑循环的其余部分。
Listing 3 shows the remainder of the main logic loop.
清单3显示了主逻辑循环的其余部分。
To switch between modes, an additional check is required in each pass of the main program loop.
要在模式间进行切换,需要对主程序循环的每次循环执行额外的检查。
Create a hash keyed on E-mail address for each state name, to be checked in the main program loop.
创建与每个州名的电子邮件地址绑定的散列,将在主程序循环中检查该散列。
Listing 2 shows the beginning of the main processing loop.
清单2显示了主处理循环的开头。
In this model, called Pipelining, the main thread is used to loop through the results as they are produced by the other threads.
在这个被称为“并行管道”的模型下,主线程将会在另一个线程产出结果的同时进行循环处理。
For example, a compiler may choose to optimize a loop index variable by storing it in a register, or the cache may delay flushing a new value of a variable to main memory until a more opportune time.
例如,编译器为了优化一个循环索引变量,可能会选择把它存储到一个寄存器中,或者缓存会延迟到一个更适合的时间,才把一个新的变量值存入主存。
In my experience, it will usually be a particular inner or nested loop, or a call to some third party library methods, which is the main culprit for running the program slow.
以我的经验来看,导致程序运行速度慢得罪魁祸首可能就是某个内部或嵌套循环,也可能是对第三方库函数的调用。
Line 32 USES the "XSL: for-each" element to define the loop that creates the main part of the table, generating one line for each "emp" element occurrence.
第32行使用“xsl:for - each”元素来定义创建表的主要部分的循环,用以为每个出现的“emp”元素生成一行。
In the next section, if the cluster and shapefile node that has just been printed is the home node, exit the main loop without writing edge or linkage information.
在第二部分中,如果刚刚打印出来的聚类和shapefile节点是主节点,那么退出主循环并且不要编写边或链接信息。
The main thing to understand is that Psyco is useful for handling blocks that loop many times, and it knows how to optimize operations involving integers and floating point numbers.
主要是要明白Psyco对于处理多次循环的块是很有用的,而且它知道如何优化涉及整数和浮点数的操作。
You could program the main loop more elegantly by using fputcsv(), which handles formatting problems (see Listing 3).
您可以使用fputcsv()更便捷地对主循环编程,fputcsv() 能够帮助处理格式化问题(参见清单3)。
After the loop, another canvas, password text box, and Submit button are created and packed into the Tk main window.
在循环完成后,另一套画布、密码文本框和Submit按钮将被创建并封装到t k主窗口中。
In the infinite loop case above, all threads except main are in a waiting state (on a semaphore, or waiting for some event).
在上述死循环的情况下,所有除主线程之外的线程都处于某种等待状态(等待一个信号量,或等待某个事件)。
Earlier in the article I rewrote the main conversion function in c, and now I am going to rewrite the main loop in c. the new code is fairly straightforward (enter as convert_driver_c.c).
在本文开头我使用c语言重新编写了主转换函数,现在将使用c语言重新编写主循环。
The main loop enters an indefinite loop, waiting for events and calling callbacks, until someone calls gtk_main_quit() by closing the window.
主循环进入无限循环,等候事件并调用回调,直到有人关闭窗口,调用 gtk_main_quit() 为止。
The main loop runs until gtk_main_quit is called when the user closes the window.
主循环一直运行,直到用户关闭窗口,调用gtk_main _ quit时才结束。
Listing 10 shows the continuation of the main processing loop after the cnee events are read.
清单10展示了读取cnee事件后主处理循环的后面部分。
The window is displayed on the screen, and the application activates the main loop by calling gtk_main .
在屏幕上显示窗口,应用程序调用gtk_main,激活主循环。
By doing so, the loop in the main scope and logic in the event handler controls the final number of event handler instances.
这样,主范围内的循环和事件处理程序中的逻辑就可以控制事件处理程序的最终数目。
Then, each pass of the main loop checks for events, resets the draw state, draws the circular "portal" windows, then animates their distortion back to the current time frame.
随后,主循环在每次循环时都检查事件、重置绘图状态、绘出圆形的“门户”窗口,然后以动画形式将其失真返回当前时帧。
The main loop then looks through its internal mapping table between its signals and handlers, also called callbacks, and calls the handlers registered for the given signal on the given object.
然后主循环查询自己的信号和处理程序之间的内部映射表,也叫做回调,并调用注册到指定对象的指定信号的处理程序。
The main loop operates on a continuous check-dispatch-sleep cycle.
主循环在连续的检查-分配-睡眠周期上操作。
With the base variable declarations and subroutine complete, the program moves on to the main program loop, shown below.
完成了基本变量声明和子例程后,程序将继续进行主程序循环,如下所示。
When an event occurs, the object associated with that event emits a signal to inform the main loop that it has occurred.
当事件发生时,与这个事件对应的对象发出信号,通知主循环事件已经发生。
Listing 4 shows the beginning of the three-finger detection in the main program loop.
清单4显示了主程序循环中的三指检测的开始部分。
Stan Murch, in a uniform-like blue jacket, stood on the sidewalk in front of the Hilton and watched cab after cab make the loop in to the main entrance.
斯坦默奇穿着酷似制服的兰色夹克,站在希尔顿饭店前面的人行道上,看着出租车一辆接着一辆拐入大门口前。
In the main program loop, there is no need for the code that ignores the header lines and the first two lines of input.
在主程序循环中,代码无需忽略标题行和输入的前两行。
You create the necessary network listening sockets, register the events to be called during execution, and then start the main event loop with the libev handling the rest of the process.
创建所需的网络监听套接字,注册在执行期间要调用的事件,然后启动主事件循环,让libev处理过程的其余部分。
应用推荐