主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

mclWaitForFiguresToDie

使已部署的应用程序能够处理图形事件,以便图形窗口保持显示

大纲

void mclWaitForFiguresToDie(HMCRINSTANCE instReserved) 

说明

调用 void mclWaitForFiguresToDie 可使部署的应用程序处理图形事件。

NULLMATLAB® Runtime 实例 (HMCRINSTANCE instReserved) 唯一接受的参数。

此函数只能在调用 libraryInitialize 之后和调用 libraryTerminate 之前调用。

mclWaitForFiguresToDie 模块所有打开的图形。该函数一直运行直到不再有可见的图形为止。此时,如果存在隐形图形,它会显示警告。此函数仅在最后一个图形窗口手动关闭时返回 - 因此,应在库运行至少一个图形窗口后调用此函数。该函数可能会被调用多次。

如果不调用此函数,应用程序最初显示的任何图形窗口都会短暂出现,然后应用程序退出。

注意

mclWaitForFiguresToDie 仅模块针对 MATLAB 图形的调用程序。它不会模块任何 Java® GUI、ActiveX® 控件或其他非 MATLAB GUI,除非它们嵌入在 MATLAB 图形窗口中。

示例

int run_main(int argc, const char** argv)
{
		int some_variable = 0;
		if (argc > 1)
			 test_to_run = atoi(argv[1]);
    
    /* Initialize application */

    if( !mclInitializeApplication(NULL,0) )
    {
			fprintf(stderr,
						"An error occurred while
								initializing: \n %s ",
						mclGetLastErrorMessage());
			return -1;
		}

		if (test_to_run == 1 || test_to_run == 0)
		{
			/* Initialize ax1ks library */
			if (!libax1ksInitialize())
			{
					fprintf(stderr,
							"An error occurred while
								initializing: \n %s ",
							mclGetLastErrorMessage());
					return -1;
			}
		}

		if (test_to_run == 2 || test_to_run == 0)
		{
			/* Initialize simple library */
			if (!libsimpleInitialize())
			{
					fprintf(stderr,
							"An error occurred while
								initializing: \n %s ",
							mclGetLastErrorMessage());
					return -1;
			}
		}

		/* your code here
		/* your code here
		/* your code here
		/* your code here
		/*
		/* Block on open figures */
			mclWaitForFiguresToDie(NULL);
		/* Terminate libraries */
			if (test_to_run == 1 || test_to_run == 0)
				libax1ksTerminate();
			if (test_to_run == 2 || test_to_run == 0)
				libsimpleTerminate();
		/* Terminate application */
			mclTerminateApplication();
      return(0);
}

版本历史记录

在 R2009a 中推出