Comments (8)
scratch link使用native方案,所以可以使用系统特性(小图标是系统特性)
如果要实现这个功能,有两个思路,其一是依赖于一个强大的UI库,来提供跨平台的支持。目前我在qt(pyqt5)中似乎没看到这个支持。
方案二是使用python包装过的系统库,如pywin32(Windows)、pyobjc(Mac)
目前我使用pyobjc完成在mac上的图标功能了。源码一时找不到,等我找到之前的实验代码,我贴过来。
用pyqt5 这个库加个小图标,挺简单的你看这个链接。 我感觉就这一次迁移框架的时候,就添加tray icon的代码就好了。
链接
按道理,pyqt5 应该是跨平台的,我刚刚在windows,mac上测试过了上面链接里的代码,运行成功了。
from codelab_adapter_extensions.
scratch link使用native方案,所以可以使用系统特性(小图标是系统特性)
如果要实现这个功能,有两个思路,其一是依赖于一个强大的UI库,来提供跨平台的支持。目前我在qt(pyqt5)中似乎没看到这个支持。
方案二是使用python包装过的系统库,如pywin32(Windows)、pyobjc(Mac)
目前我使用pyobjc完成在mac上的图标功能了。源码一时找不到,等我找到之前的实验代码,我贴过来。
from codelab_adapter_extensions.
我找到之前的一些笔记
- 在mac下原生的NSStatusBar: rumps
- using PyObjC
- https://stackoverflow.com/questions/10691222/nsstatusitem-in-python
- https://code-examples.net/en/q/22878 使用rumps包装pyobjc
from AppKit import NSStatusBar
status_item = NSStatusBar.systemStatusBar().statusItemWithLength_(-1) #NSVariableStatusItemLength
status_item.setImage_(<NSImage instance to status icon>)
from codelab_adapter_extensions.
在windows下,这个功能名字叫Tray Icon
, 在关键字的帮助下,Google到QT对其提供了支持!
https://doc.qt.io/archives/qt-4.8/qt-desktop-systray-example.html
from codelab_adapter_extensions.
linux考虑 https://github.com/martinohanlon/shortcut 帮助启动
from codelab_adapter_extensions.
@bilikyar 太棒了
from codelab_adapter_extensions.
from codelab_adapter_extensions.
@wwj718 Copy,Pyqt5 做这个再好不过了 😋
from codelab_adapter_extensions.
Related Issues (20)
- cmder下载后出问题,运行不成,文件坏了 HOT 6
- 证书更新 HOT 4
- pyinstaller 3.5 增加 jupyterlab的钩子 HOT 2
- 关于树莓派插件 HOT 3
- 除了EIM之外其他的scratch插件在哪能看到呢? HOT 4
- 更新codelab-adapter-mac-2_5_3之后使用cozmo插件出下面的提示 HOT 5
- 在windows下运行python-kernel-extension错误 HOT 4
- Extension_vector HOT 2
- Physical Blocks Scratch HOT 1
- 发现physical blocks 2.0中json列表是从右往左取的
- Extension中執行到while循環來執行攝像頭數據讀取后,疑似綫程阻塞導致插件無法响應後面的eim消息, 請教有沒有什麽辦法可以解決? HOT 2
- 请问下codelab可以打包成exe在本地运行吗? HOT 2
- 请教下 本项目和下载版本的区别 HOT 1
- 请问toio是通过什么方式连接的。 HOT 1
- 同时使用多个相同的MarkerID
- 希望把ESP32接入codelab,但是没有成功,能否给予一些例子。 HOT 4
- 请求大师adapter连接Arduino不成功总显示none type object HOT 6
- 老师,路过的好心人,能帮看看Arduino连接的nonetype错吗 HOT 1
- Scratch3 Alphamini extension and enabling other features HOT 9
- 可以看到Extension和Node具体实现差异么 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codelab_adapter_extensions.