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

📄 listing_8_27.c

📁 This source code has been tested under OpenWindows 2.0, Sun s X11/NeWS server. For Xlib programs th
💻 C
字号:
/*************************************************************************                                                                    ****  listing_8_27.c                                                    ****                                                                    ****  Demonstration of actions and translations, using a pushbutton.    ****                                                                    *************************************************************************/#include <Xm/PushB.h>void	ActionOne();			/* FORWARD definitions	     */void	ActionTwo();Widget		appshell,		the_btn;XtActionsRec	action_tab[] =	{				{ "actionOne", ActionOne },				{ "actionTwo", ActionTwo }				};void main( argc, argv )    int     argc;    char    *argv[];{    appshell = XtInitialize( argv[0], "Listing_8_27", NULL, 0, &argc, argv );    XtAddActions( action_tab, XtNumber(action_tab) );    the_btn = XmCreatePushButton( appshell, "TheBtn", NULL, 0 );    XtManageChild( the_btn );    XtRealizeWidget( appshell );    XtMainLoop();}void ActionOne( w, event, params, num_params )    Widget      w;    XEvent	*event;    char	*params[];    int		*num_params;{    int		i;    printf( "\nAction 1 Invoked\n" );    printf( "    %d Params:", *num_params );    for (i = 0 ;  i < *num_params ;  i++)	printf( " %s", params[i] );    printf( "\n" );}void ActionTwo( w, event, params, num_params )    Widget      w;    XEvent	*event;    char	*params[];    int		*num_params;{    int		i;    printf( "\nAction 2 Invoked\n" );    printf( "    %d Params:", *num_params );    for (i = 0 ;  i < *num_params ;  i++)	printf( " %s", params[i] );    printf( "\n" );}

⌨️ 快捷键说明

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