回复:无图形界面选项

中本聪SN-10153
阅读完整通信正文 · Martti Malmi · 2010-02-15 · 回复:JSON-RPC 进展
相关通信Martti Malmi→ 中本聪原文来源 ↗原信文本(含旧引文) ↗

我刚从他们的 SVN 下载了 python-json-rpc(http://json-rpc.org/wiki/python-json-rpc),直接与 Python 解释器交互做了测试。像这样:

Just downloaded the python-json-rpc
(http://json-rpc.org/wiki/python-json-rpc) from their svn and tested
by talking to the Python interpreter directly. Like this:

pythons = ServiceProxy("http://localhost:8332")
s.getblockcount()
pythons = ServiceProxy("http://localhost:8332")
s.getblockcount()
阅读完整通信正文 · Martti Malmi · 2010-02-17 · 无图形界面选项
相关通信Martti Malmi→ 中本聪原文来源 ↗原信文本 ↗

关于怎样让同一个二进制程序在没有图形界面的情况下运行,我找到了一些线索:

Just a few clues I've found about running the same binary without a GUI:

  1. GTK 支持在没有显示环境时运行程序:http://library.gnome.org/devel/gtk/2.12/gtk-General.html#gtk-init-check。不过,这里没有说明 wxWidgets 是否也能做到。
  1. 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.
  1. wx 2.9 的 wxAppConsole 也许能派上用场。仅仅把 wxApp 替换成 wxAppConsole 并不能工作,我不确定应该怎样使用它。相关文档不太完善。
  1. wxAppConsole of wx 2.9 might be useful somehow. Just replacing
    wxApp with wxAppConsole doesn't work, I'm not sure how it should be
    used. It's not very well documented.
  1. 另一个选择也许是使用 IMPLEMENT_APP_NO_MAIN(),自己编写 main 方法。
  1. Another option might be to use IMPLEMENT_APP_NO_MAIN() and make our
    own main method.
引用 Martti Malmi 的文字Martti Malmi来源 ↗

我找到了一些关于让同一二进制文件无图形界面运行的线索:

Just a few clues I've found about running the same binary without a GUI:

  1. GTK 支持在没有显示的情况下运行程序: http://library.gnome.org/devel/gtk/2.12/gtk-General.html#gtk-init-check. 不过这并没有说明在 wxWidgets 中是否可行。
  1. 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)

译文校对、修订与纠错

当前版本尚未建立逐条校对状态记录。来源核验、历史审校与当前译文校对是不同事项。

查看历史审校与代表修订 →

译文内容版本:4da67f95ef1c。用于比对文本,不代表校对等级或更新时间。

准备纠错说明

请填写对应原文、现译文、建议译法和理由。复制后通过你联系本站作者的渠道提交;此处不会自动发送。

来源
英文原标题

Re: Non-GUI option

Martti Malmi 通信 · 收件人公开存档 ↗ 下载英文正文 COPA v. Wright Trial Exhibits ↗ 原始通信编号 #168 · 阅读完整往来 ↗ 记录编号 SN-10153

阅读字号

选择适合你的字号,之后阅读会继续使用。