📄 listing_9_02.c
字号:
/************************************************************************* **** listing_9_02.c **** **** Demonstration of tab groups. This program uses one parent form **** with three children: two row-columns (each containing 3 buttons) **** and a pushbutton. Each of the form's children is a tab group. **** *************************************************************************/#include <Xm/Form.h>#include <Xm/RowColumn.h>#include <Xm/PushB.h>Widget appshell, /* Application Shell */ the_form, /* The parent form */ rc_0, rc_1, /* The row-column children */ the_btn, /* The button child */ btns_0[3], btns_1[3]; /* Children of the rowcols */void main( argc, argv ) int argc; char *argv[];{ appshell = XtInitialize( argv[0], "Listing_9_02", NULL, 0, &argc, argv ); the_form = XmCreateForm( appshell, "TheForm", NULL, 0 ); XtManageChild( the_form ); the_btn = XmCreatePushButton( the_form, "TheBtn", NULL, 0 ); XtManageChild( the_btn ); rc_0 = XmCreateRowColumn( the_form, "RowCol0", NULL, 0 ); XtManageChild( rc_0 ); btns_0[0] = XmCreatePushButton( rc_0, "RC0_Btn0", NULL, 0 ); btns_0[1] = XmCreatePushButton( rc_0, "RC0_Btn1", NULL, 0 ); btns_0[2] = XmCreatePushButton( rc_0, "RC0_Btn2", NULL, 0 ); XtManageChildren( btns_0, 3 ); rc_1 = XmCreateRowColumn( the_form, "RowCol1", NULL, 0 ); XtManageChild( rc_1 ); btns_1[0] = XmCreatePushButton( rc_1, "RC1_Btn0", NULL, 0 ); btns_1[1] = XmCreatePushButton( rc_1, "RC1_Btn1", NULL, 0 ); btns_1[2] = XmCreatePushButton( rc_1, "RC1_Btn2", NULL, 0 ); XtManageChildren( btns_1, 3 ); XmAddTabGroup( the_btn ); XmAddTabGroup( rc_0 ); XmAddTabGroup( rc_1 ); XtRealizeWidget( appshell ); XtMainLoop();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -