<small id='KXI7g'></small><noframes id='KXI7g'>

    <legend id='KXI7g'><style id='KXI7g'><dir id='KXI7g'><q id='KXI7g'></q></dir></style></legend>

      <tfoot id='KXI7g'></tfoot>
      • <bdo id='KXI7g'></bdo><ul id='KXI7g'></ul>

      1. <i id='KXI7g'><tr id='KXI7g'><dt id='KXI7g'><q id='KXI7g'><span id='KXI7g'><b id='KXI7g'><form id='KXI7g'><ins id='KXI7g'></ins><ul id='KXI7g'></ul><sub id='KXI7g'></sub></form><legend id='KXI7g'></legend><bdo id='KXI7g'><pre id='KXI7g'><center id='KXI7g'></center></pre></bdo></b><th id='KXI7g'></th></span></q></dt></tr></i><div id='KXI7g'><tfoot id='KXI7g'></tfoot><dl id='KXI7g'><fieldset id='KXI7g'></fieldset></dl></div>
      2. 如何使用 Pyinstaller 打包的 Kivy Python 应用程序在 OSX 菜单栏中创建菜单项?

        时间:2023-06-07
          <tbody id='uK6t3'></tbody>

      3. <legend id='uK6t3'><style id='uK6t3'><dir id='uK6t3'><q id='uK6t3'></q></dir></style></legend>

          • <bdo id='uK6t3'></bdo><ul id='uK6t3'></ul>
          • <i id='uK6t3'><tr id='uK6t3'><dt id='uK6t3'><q id='uK6t3'><span id='uK6t3'><b id='uK6t3'><form id='uK6t3'><ins id='uK6t3'></ins><ul id='uK6t3'></ul><sub id='uK6t3'></sub></form><legend id='uK6t3'></legend><bdo id='uK6t3'><pre id='uK6t3'><center id='uK6t3'></center></pre></bdo></b><th id='uK6t3'></th></span></q></dt></tr></i><div id='uK6t3'><tfoot id='uK6t3'></tfoot><dl id='uK6t3'><fieldset id='uK6t3'></fieldset></dl></div>

              <small id='uK6t3'></small><noframes id='uK6t3'>

              <tfoot id='uK6t3'></tfoot>

                  本文介绍了如何使用 Pyinstaller 打包的 Kivy Python 应用程序在 OSX 菜单栏中创建菜单项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  为了在我的 Pyinstaller 打包的 Kivy Python 应用程序中实现原生感,我想在 OSX 菜单栏中创建菜单项.如果使用 PyQt,我可以轻松实现这一点.但是由于我使用的是 Kivy,我似乎不得不求助于其他方式.

                  To achieve sense of nativeness in my Pyinstaller packaged Kivy Python application, I would like to create menu item in OSX menu bar. If using PyQt, I can easily achieve this. But as I am using Kivy, it seems like I have to resort to other ways.

                  有什么建议吗?我猜它会在 PyObjc 或 AppleScript 的范围内.不过不确定.

                  Any suggestion? I guess it will be in the range of PyObjc or AppleScript. Not sure though.

                  推荐答案

                  我想这更像是 Pyinstaller 的问题,它是 Kivy 的问题.

                  I guess this is more to Pyinstaller question that it is as Kivy question.

                  两者都不是:)

                  PyInstaller 只是将 python 应用程序包装到一个看起来像本机的 OS X 应用程序包中.
                  由于 Kivy 无法在 OS X 中创建菜单栏图标,因此您必须坚持使用 PyObjC.

                  PyInstaller just wraps the python application into a native-looking OS X application bundle.
                  Since Kivy doesn't have the ability to create a menu bar icon in OS X, you have to stick with PyObjC.

                  首先,您必须安装 Xcode(如果尚未安装).您可以从 App Store 或 Apple 的开发者中心 下载它.

                  First, you've got to install Xcode (if not installed yet). You can download it from the App Store or from the Apple's Developer Center.

                  然后安装 PyObjC 本身:

                  Then install PyObjC itself:

                  pip install pyobjc
                  

                  已经有一些例子了(first, another) 关于使用 PyObjC 创建状态栏图标.

                  There are already some examples (first, another) on creating a status bar icon using PyObjC.

                  还有一个很棒的库,叫做 rumps,它极大地简化了代码需要制作状态栏图标、菜单和操作.也许它可以帮助您进行状态栏交互.

                  There's also an awesome library called rumps which greatly simplifies the code needed to make status bar icons, menus and actions. Perhaps it may help you with status bar interacting.

                  这篇关于如何使用 Pyinstaller 打包的 Kivy Python 应用程序在 OSX 菜单栏中创建菜单项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Kivy - python - recycleview 行中的多个小部件 下一篇:kv 语言中的 Kivy 屏幕管理器参考

                  相关文章

                  • <bdo id='WXa3Z'></bdo><ul id='WXa3Z'></ul>

                  <small id='WXa3Z'></small><noframes id='WXa3Z'>

                1. <tfoot id='WXa3Z'></tfoot>

                    1. <legend id='WXa3Z'><style id='WXa3Z'><dir id='WXa3Z'><q id='WXa3Z'></q></dir></style></legend>
                      <i id='WXa3Z'><tr id='WXa3Z'><dt id='WXa3Z'><q id='WXa3Z'><span id='WXa3Z'><b id='WXa3Z'><form id='WXa3Z'><ins id='WXa3Z'></ins><ul id='WXa3Z'></ul><sub id='WXa3Z'></sub></form><legend id='WXa3Z'></legend><bdo id='WXa3Z'><pre id='WXa3Z'><center id='WXa3Z'></center></pre></bdo></b><th id='WXa3Z'></th></span></q></dt></tr></i><div id='WXa3Z'><tfoot id='WXa3Z'></tfoot><dl id='WXa3Z'><fieldset id='WXa3Z'></fieldset></dl></div>