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

📄 ctrlpanel.h

📁 `smith.motif.tar.Z includes the source code for the book "Designing X clients with Xt/Motif," by Je
💻 H
字号:
/**** ctrlpanel.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 _ctrlPanel_h#define _ctrlPanel_h#include <stdio.h>#include <Xm/Xm.h>#include <Xm/Frame.h>#include <Xm/PushB.h>#include <Xm/Separator.h>#include <Xm/RowColumn.h>#include "ctrlpanelP.h"/*Constants used to control horizontal or vertical orientation:*/#define ctrlPanel_HORIZONTAL	-100#define ctrlPanel_VERTICAL		-101#define ctrlPanel_NULL			-102/*Public opaque pointer:*/typedef _CtrlPanel *CtrlPanel;/*Public convenience structure access for controlpanel buttons and their callback functions:*/typedef _CtrlPanelItem *CtrlPanelList;typedef _CtrlPanelItem CtrlPanelItem;/*Public functions:*/extern CtrlPanel ctrlPanel_create();extern void ctrlPanel_destroy();extern Widget ctrlPanel_instance();extern Widget ctrlPanel_class();extern Widget ctrlPanel_ctrlBox();#endif /* _ctrlPanel_h */

⌨️ 快捷键说明

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