使用 IronPython 开发跨平台 GUI:wx.NET 以获得真正的本机外观和感觉?
显然,使用 IronPython,可以通过为每个平台编写不同的 GUI 层(Linux 上的 GTK#,Windows 上的 WinForms...)来创建一流的用户体验,
尽管我正在认真考虑这样做,尽管这个小小的计算机科学家我的头在尖叫。避免这种重复的一种选择是使用 wxWidgets 工具包,它能够在多个平台上提供真正的本机外观和感觉。由于我计划使用 IronPython,因此我想这将涉及 wx.NET 包装器的使用。
我的问题是:是否可以在 IronPython 中使用 wx.NET 包装器?更重要的是:在 IronPython 中使用 wx.NET 容易吗?我四处搜寻,没有发现太多人们在其他地方使用这种组合的证据。有人同时使用这两种技术吗?或者听说过这样的项目吗?
谢谢!
Obviously, with IronPython it's possible to create a first-class user experience by writing a different GUI layer for each platform (GTK# on Linux, WinForms on Windows...)
I'm seriously considering doing this, though the little Computer Scientist in my head is screaming. One option to avoid this duplication would be to use the wxWidgets toolkit, which is capable of providing a truly native look and feel on multiple platforms. Since I'm planning to use IronPython, I would imagine that this would involve the use of the wx.NET wrapper.
My question is this: is it possible to use the wx.NET wrapper in IronPython? More importantly: is it EASY to use wx.NET in IronPython? I've searched around, and haven't found much evidence of people using this combination elsewhere. Has anyone used these two technologies together, or heard of a project that does?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我花了一些时间研究 IronPython 和 wx.NET 库,并且发现可以从 IronPython 使用 wx.NET。我创建了一个小示例应用程序来演示基本思想(在 Linux 上使用 Mono 2.8.1 和 IronPython 2.6.1 进行了测试)。 XRC 文件是使用 wxFormBuilder 创建的。使用 IronPython 创建 wx.NET GUI 似乎应该很容易;它看起来与等效的 C# 代码大致相同。
hello_frame.pyw:
hello_frame.xrc:
I've spent some time playing around with IronPython and the wx.NET library, and I've found that it is possible to use wx.NET from IronPython. I've created a little sample application that demonstrates the basic idea (tested with Mono 2.8.1 and IronPython 2.6.1 on Linux). The XRC file was created using wxFormBuilder. It seems as though it should be pretty easy to create a wx.NET GUI using IronPython; it looks about the same as the equivalent C# code.
hello_frame.pyw:
hello_frame.xrc: