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

📄 main.c

📁 This source code has been tested under OpenWindows 2.0, Sun s X11/NeWS server. For Xlib programs th
💻 C
字号:
/*************************************************************************                                                                    ****  main.c                                                            ****                                                                    ****  Text Editor -- Main Module                                        ****                                                                    ****  Revision 9: Addition of XmText direct clipboard interface.        ****                                                                    *************************************************************************/#include <Xm/MainW.h>#include <Xm/Text.h>#include "textedit.h"/*************************************************************************                                                                    ****               F O R W A R D   D E F I N I T I O N S                ****                                                                    *************************************************************************/static	void	InitMainWindow();static	void	InitWorkWindow();/*************************************************************************                                                                    ****                   G L O B A L   V A R I A B L E S                  ****                                                                    *************************************************************************/Widget	appshell,			/* Application Shell          */	mainwin,			/* XmMainWindow		      */	menubar,			/* MainWindow Menu Bar	      */	workwin,			/* MainWindow Work Area       */	textwin;			/* Work Window XmText widget  */Arg	arglist[16];			/* For programmatic rsrc stuf */Boolean	saved;				/* Used for save alert	      *//*************************************************************************                                                                    ****  main( argc, argv )                                                ****                                                                    ****  Program entry point. Creates shell, calls initialization funcs,   ****  and turns control over to event loop.                             ****                                                                    *************************************************************************/void main( argc, argv )    int     argc;    char    *argv[];{    appshell = XtInitialize( argv[0], "TextEdit", NULL, 0, &argc, argv );    InitMainWindow();    InitMenuBar();    InitWorkWindow();    XmMainWindowSetAreas( mainwin, menubar, NULL, NULL, NULL, workwin );    InitOther();    XtRealizeWidget( appshell );    XtMainLoop();}/*************************************************************************                                                                    ****  InitMainWindow()                                                  ****                                                                    ****  This function creates the main window widget and its scrollbars.  ****  The main window is created as a child of the application shell.   ****  The scrollbars are either created along with the main-window (if  ****  its "scrollingPolicy" resource contains TRUE) or separately.      ****                                                                    ****  This function modifies the global "mainwin", and accesses the     ****  global "appshell".                                                ****                                                                    *************************************************************************/static void InitMainWindow(){    mainwin = XmCreateMainWindow( appshell, "MainWin", NULL, 0 );    XtManageChild( mainwin );}/*************************************************************************                                                                    ****  InitWorkWindow()                                                  ****                                                                    ****  This function creates the work window and its children. The       ****  work window is created as the child of the main window.           ****                                                                    ****  This function modifies the globals "workwin" and "textwin", and   ****  accesses the global "mainwin".                                    ****                                                                    *************************************************************************/static void InitWorkWindow(){    textwin = XmCreateScrolledText( mainwin, "WorkWin", NULL, 0 );    XtManageChild( textwin );    workwin = XtParent( textwin );}

⌨️ 快捷键说明

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