⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dowhenidle.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1990 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) DoWhenIdle.3 1.6 97/05/09 18:18:33'\" .so man.macros.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures".BS.SH NAMETcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pending events.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.sp\fBTcl_DoWhenIdle\fR(\fIproc, clientData\fR).sp\fBTcl_CancelIdleCall\fR(\fIproc, clientData\fR).SH ARGUMENTS.AS Tcl_IdleProc clientData.AP Tcl_IdleProc *proc inProcedure to invoke..AP ClientData clientData inArbitrary one-word value to pass to \fIproc\fR..BE.SH DESCRIPTION.PP\fBTcl_DoWhenIdle\fR arranges for \fIproc\fR to be invokedwhen the application becomes idle.  The application isconsidered to be idle when \fBTcl_DoOneEvent\fR has beencalled, couldn't find any events to handle, and is aboutto go to sleep waiting for an event to occur.  At thispoint all pending \fBTcl_DoWhenIdle\fR handlers areinvoked.  For each call to \fBTcl_DoWhenIdle\fR there willbe a single call to \fIproc\fR;  after \fIproc\fR isinvoked the handler is automatically removed.\fBTcl_DoWhenIdle\fR is only usable in programs thatuse \fBTcl_DoOneEvent\fR to dispatch events..PP\fIProc\fR should have arguments and result that match thetype \fBTcl_IdleProc\fR:.CStypedef void Tcl_IdleProc(ClientData \fIclientData\fR);.CEThe \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fRargument given to \fBTcl_DoWhenIdle\fR.  Typically, \fIclientData\fRpoints to a data structure containing application-specific information aboutwhat \fIproc\fR should do..PP\fBTcl_CancelIdleCall\fRmay be used to cancel one or more previouscalls to \fBTcl_DoWhenIdle\fR:  if there is a \fBTcl_DoWhenIdle\fRhandler registered for \fIproc\fR and \fIclientData\fR, then itis removed without invoking it.  If there is more than onehandler on the idle list that refers to \fIproc\fR and \fIclientData\fR,all of the handlers are removed.  If no existing handlers match\fIproc\fR and \fIclientData\fR then nothing happens..PP\fBTcl_DoWhenIdle\fR is most useful in situations where(a) a piece of work will have to be done but (b) it'spossible that something will happen in the near futurethat will change what has to be done or require somethingdifferent to be done.  \fBTcl_DoWhenIdle\fR allows theactual work to be deferred until all pending events havebeen processed.  At this point the exact work to be donewill presumably be known and it can be done exactly once..PPFor example, \fBTcl_DoWhenIdle\fR might be used by an editorto defer display updates until all pending commands havebeen processed.  Without this feature, redundant redisplaysmight occur in some situations, such as the processing ofa command file..SH BUGS.PPAt present it is not safe for an idle callback to reschedule itselfcontinuously.  This will interact badly with certain features of Tkthat attempt to wait for all idle callbacks to complete.  If you wouldlike for an idle callback to reschedule itself continuously, it isbetter to use a timer handler with a zero timeout period..SH KEYWORDScallback, defer, idle callback

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -