简体   繁体   English

如何使用具有原生外观的小部件为MacOS开发和创建自包含的PyGTK应用程序包?

[英]How do I develop and create a self-contained PyGTK application bundle for MacOS, with native-looking widgets?

I have read that it is possible to build GTK+ on MacOS X . 我已经读过可以在MacOS X上构建GTK + I know that it's possible to create a bundle of a GTK+ application on MacOS . 我知道可以在MacOS上创建一个GTK +应用程序包 I also know that it's possible to create widgets that look sort of native . 我也知道可以创建看起来像原生的小部件。 However, searching around I am not really clear on how to create a bundle that includes the native theme stuff, and uses Python rather than its own C main-point. 然而,搜索我并不是很清楚如何创建一个包含本机主题的包,并使用Python而不是它自己的C主点。 There are also rumors that it's possible to build PyGTK , but it sounds like there might still be some wrinkles in that process. 也有传言说可以建立PyGTK ,但听起来在这个过程中可能还会有一些皱纹。

However, there is no step-by-step guide that explains how one can set up an environment where an application might be run from Python source, then built and deployed in an app bundle. 但是,没有逐步指导解释如何设置一个环境,其中应用程序可以从Python源运行,然后在应用程序包中构建和部署。 How can I go about doing that? 我怎么能这样做呢?

Native looking widgets is quite complicated. 看起来像本地的小部件非常复杂。 There's a beginning of quartz engine (for theming) found here http://git.gnome.org/browse/gtk+/tree/gdk/quartz For self-contained applications check out the newly released bundle on http://live.gnome.org/GTK%2B/OSX 这里有一个石英引擎(用于主题)的开始http://git.gnome.org/browse/gtk+/tree/gdk/quartz对于自包含的应用程序,请查看http://live.gnome上新发布的软件包.ORG / GTK%2B / OSX

I'm not sure if I'm grokking all the details of your question, but looking at your problem in general (how do I deploy a python app on mac), I'm inclined to say that the answer is py2app . 我不确定我是否正在研究你的问题的所有细节,但总体上看你的问题(如何在mac上部署python应用程序),我倾向于说答案是py2app Basically this will bundle a python interpreter and all relevant python files for you, and give you a scriptable system that you can use to add in whatever other resources/dependencies you need. 基本上,这将为您捆绑一个python解释器和所有相关的python文件,并为您提供一个可编写脚本的系统,您可以使用该系统添加您需要的任何其他资源/依赖项。

While it's not a guide solely targetted at python/GTK+/OS X, this post is a good, detailed description of someone else's attempt to do most of what you describe. 虽然它不是针对python / GTK + / OS X的指南,但这篇文章是对其他人试图完成您所描述的大部分内容的详细描述。 Obviously, the app-specific stuff is going to vary. 显然,应用程序特定的东西会有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM