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

📄 listing_8_30.c

📁 This source code has been tested under OpenWindows 2.0, Sun s X11/NeWS server. For Xlib programs th
💻 C
字号:
/*************************************************************************                                                                    ****  listing_8_30.c                                                    ****                                                                    ****  Demonstration of accelerators, using two pushbuttons.             ****                                                                    *************************************************************************/#include <Xm/BulletinBP.h>#include <Xm/LabelP.h>#include <Xm/PushBP.h>#include <Xm/BulletinB.h>#include <Xm/PushB.h>void    Btn1CB();                       /* FORWARD Definition         */Widget  appshell,        the_bb,        buttons[2];void main( argc, argv )    int     argc;    char    *argv[];{    appshell = XtInitialize( argv[0], "Listing_8_30", NULL, 0, &argc, argv );    the_bb = XmCreateBulletinBoard( appshell, "BB", NULL, 0 );    XtManageChild( the_bb );    buttons[0] = XmCreatePushButton( the_bb, "Button_0", NULL, 0 );    buttons[1] = XmCreatePushButton( the_bb, "Button_1", NULL, 0 );    XtManageChildren( buttons, 2 );    XtAddCallback( buttons[1], XmNactivateCallback, Btn1CB, NULL );    XtInstallAccelerators( buttons[0], buttons[1] );    XtRealizeWidget( appshell );    XtMainLoop();}void Btn1CB( w, client_data, call_data )    Widget              w;    caddr_t             client_data;    XmAnyCallbackStruct *call_data;{    printf( "\nButton 1 Activated\n" );    if (call_data->event == NULL)        printf( "Event is NULL\n" );    else        printf( "Event is not NULL\n" );}

⌨️ 快捷键说明

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