打开一个使用Ncurses的图形窗口

时间:2019-01-11 16:52:35

标签: user-interface terminal ncurses

假设我在某些图形X窗口环境之上运行xterm或其他终端仿真器。例如,在KDE上的xterm。我想编写一个可以在一个终端仿真器的命令行上调用的应用程序,执行后,该应用程序将创建一个 new KDE / Environment窗口,与当前的终端仿真器分开,并在该窗口上新窗口出于应用目的运行Ncurses上下文。

我该怎么做?此终端仿真器是否依赖?桌面环境依赖?我会使用裸X窗口系统调用吗?

1 个答案:

答案 0 :(得分:0)

取决于终端(仿真器)。

诅咒在终端和终端仿真器中运行。后者中的大多数(终端仿真器)都有某种方式来告诉要在终端仿真器中运行的程序(除了您的Shell)。

例如,可以使用-e选项来告知xterm,

   -e program [ arguments ... ]
           This option specifies the program (and its command line
           arguments) to be run in the xterm window.  It also sets the
           window title and icon name to be the basename of the program
           being executed if neither -T nor -n are given on the command
           line.

           NOTE: This must be the last option on the command line.

让您启动运行{em> MyApplication 的xterm,如下所示:

xterm -e MyApplication

同样,您可能在X中运行的大多数终端仿真器都接受该选项。 KDE konsole做到了。没有手册,但是

konsole --help-all

在最后显示它。