python - Python TKMACOSX Button Anchor 从中心开始
问题描述
我正在使用 tkmaxosx(MacOS、Pycharm 2020.2.3、Python 3.8)在 Python 应用程序中放置按钮。我希望按钮文本在按钮的左上角起作用,所以我设置了“anchor=NW”。
问题是,声明的点是使用按钮的中心点作为固定参考点。这是代码:
foo=Button(foowin, text='Test Text', anchor=NW, height=18, width=145, bg='SystemButtonFace', command=lambda rn=i: FooCommand(variables))
这是结果,显示了不同的锚点: 显示 NW、E、W、SE 锚点
解决方案
tkmacosx 按钮的锚定问题已在 tkmacosx-0.1.6 版本中得到修复。你可以升级它
pip install tkmacosx --upgrade
推荐阅读
- flutter - 从地图选择器地址中提取地址组件
- html - 如何在div中重叠图像
- firebase - 构建失败可能是由于插件中的 AndroidX 不兼容,线程“main”java.util.zip.ZipException 中的异常
- linux - 创建类路径资源中定义的名称为“entityManagerFactory”的bean时出错:创建名称为“entityManagerFactory”的bean时出错
- spring - “如何使用 Micrometer 和 Gauge 将字符串列表发送到 Grafana?我在下面尝试了此代码,但它不起作用”
- c++ - 在数组中查找元素的问题 - c++20
- python - 重新连接观察到的共享文件夹后如何保持看门狗工作?
- sql - 第 1 行第 14 列(已创建)的批量加载数据转换错误(截断)
- javascript - 使用 Audio() 的怪癖
- ruby-on-rails - 预加载连接多个值的记录