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

📄 ctrlpanelp.h

📁 `smith.motif.tar.Z includes the source code for the book "Designing X clients with Xt/Motif," by Je
💻 H
字号:
/**** ctrlpanelP.h ****//**************************************************************************A `CtrlPanel' object is a Motif XmRowColumn widget that enforcesa simple horizontal or vertical layout, and facilitates theassociation of callback functions with control panel buttons.The application sets up a null-terminated structure of button-label and callback pairs and then passes this structure toctrlPanel_create().  A {"", NULL, NULL} tuple is replaced by anXmSeparator.The data structures for using `CtrlPanel' are illustrated by thefollowing code segment:#include "ctrlpanel.h"......static void Quit(), Print();	// callbacks //......void main(argc, argv)int argc;char *argv[];{	Widget topLevel;	CtrlPanel panel;	static CtrlPanelItem items[] = {			// array of `CtrlPanelItem's	//		// {<label>, <name>, <callback>, <data>} tuples //		{"Quit", "quitButton", Quit, NULL},		{"Print", "printButton", Print, NULL},		NULL,									// null-terminated //	};	XtAppContext app;	topLevel = XtAppInitialize(&app, "ApplicationClass",		(XrmOptionDescList) NULL, 0,		&argc, argv, (String *) NULL, (ArgList) NULL, 0);	panel = ctrlPanel_create(topLevel, "panel", items,		XmSTRING_DEFAULT_CHARSET, ctrlPanel_HORIZONTAL);	...	...	ctrlPanel_destroy(panel);			// probably from a callback //	...	...**************************************************************************/#ifndef _ctrlpanelP_h#define _ctrlpanelP_h/*Constants:*/#define MAX_TEMP_STR	30/*Private structure for the CtrlPanel widget:*/typedef struct {	void *self;	Widget instance;	Widget class;	Widget ctrlBox;	Widget *buttons;		/* or `WidgetList buttons;' */} _CtrlPanel;/*Private convenience structure for the items and their callbacks:*/typedef struct {	char *label;	char *name;	void (*callback)();		/* should NOT be XtCallbackProc */	XtPointer client_data;} _CtrlPanelItem;#endif /* _ctrlpanelP_h */

⌨️ 快捷键说明

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