main.cc

来自「QNX实时操作系统里的GUI是c格式的」· CC 代码 · 共 77 行

CC
77
字号
#include <Ap.h>#include <photon/PtWindow.h>#ifndef NDEBUG#    include <photon/PtLabel.h>#endif#include "photonmm/Main.h"// namespace Ap {        extern PtWidget_t* main_widget;        PtAppContext_t cnt;                Main::Main (int *  argc, char* argv[]  )        {                main_widget = PtAppInit (&cnt, argc, argv, 0, NULL  );        }        void        Main::run ()        {       #ifndef NDEBUGPtArg_t argt[5];int i =0;PhPoint_t pos = { 0, 0 };char* str = "Debug View.";PhDim_t dim = { 200, 150 };PtSetArg (&argt[i++], Pt_ARG_TEXT_STRING, str,  0);PtSetArg (&argt[i++], Pt_ARG_POS,         &pos, 0);PtWidget_t* widget = PtCreateWidget (PtLabel, main_widget, i, argt);		PtSetResource   (main_widget, Pt_ARG_DIM,          &dim, 0);		PtSetResource   (main_widget, Pt_ARG_WINDOW_TITLE, str,  0);                PtRealizeWidget (main_widget);				#endif                PtMainLoop ();        }        void        Main::exit ()        {                PtExit (0);        }// } // namespace Ap

⌨️ 快捷键说明

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