SN-10153 附来源、原文与上下文。
引用 Martti Malmi 的文字Martti Malmi来源 ↗我找到了一些关于让同一二进制文件无图形界面运行的线索:
Just a few clues I've found about running the same binary without a GUI:
- GTK 支持在没有显示的情况下运行程序: http://library.gnome.org/devel/gtk/2.12/gtk-General.html#gtk-init-check. 不过这并没有说明在 wxWidgets 中是否可行。
- GTK supports running a program without display: http://library.gnome.org/devel/gtk/2.12/gtk-General.html#gtk-init-check. This doesn't tell if it's possible in wxWidgets though.
我看到它在 wxApp::Initialize 中调用了 gtk-init-check。
I see it calls gtk-init-check in wxApp::Initialize.
我可以在子类中重写 Initialize,抑制错误消息后调用原来的函数,并忽略返回值。看来可以运行。
I can subclass Initialize, call the original one while suppressing the error message and ignore the return value. It seems to be working.
对于命令行开关的名称和说明,有什么建议吗?有没有惯用的标准?我目前用的是: -daemon(或 -d) (启用 RPC,并在后台运行) -server (启用 RPC)
Any suggestions what to name the command line switches and how to describe them? Is there any traditional standard? I'm currently using: -daemon (or -d) (Enables RPC and runs in the background) -server (Enables RPC)