Skip to main content

General widgets for pyminer

Project description

pmgwidgets常用控件介绍

from pmgwidgets import {控件名}

用以上语句即可导入相应的控件。

设置控件SettingsPanel

查看示例即可。在tests/settings_panel中,运行示例即可得到以下界面:

创建这个界面只需要一个json式的数据结构,如下所示:

    views = [('line_edit', 'name', 'What\'s your name?', 'hzy'),
             ('number', 'age', 'How old are you?', 88, 'years old', (0, 150)),
             ('number', 'height', 'How High could This Plane fly?', 12000, 'm', (10, 20000)),
             ('bool', 'sport', 'do you like sport', True),
             ('choose_box', 'plane_type', 'plane type', 'f22', ['f22', 'f18', 'j20', 'su57'],
              ['f22战斗机', 'f18战斗轰炸机', 'j20战斗机', 'su57战斗机']),
             ('color', 'color', 'Which color do u like?', (0, 200, 0))]

这些数据的格式为: 数据类型;数据名称;提示信息;初始值。第四位之后的其他数据为修饰信息,比如单位、范围等。

返回值类型 1:选择器名称 2:数据名称 3:提示信息 4:初始值 5 6
字符串型(str) 'line_edit' str str 初始值:str / /
整型或者浮点(int/float)字符串型(str) 'number' 名称:str str int/float初始值:str 单位str 范围(min,max)
布尔型(bool) 'bool' str str bool / /
任意类型,多选一(str) 'choose_box' str str object(任意类型)* 选项列表 选项文本列表
颜色(返回形如'#a0b89d'的颜色字符串) 'color' str tupleRGB,每位为0~255的整数 /
*:注意,任意类型,多选一的下拉列表中,列表可以填入任意类型。但是你所输入的初始值,必须在选项列表中存在,否则会抛出异常。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmgwidgets-0.1.2.tar.gz (26.4 kB view details)

Uploaded Source

File details

Details for the file pmgwidgets-0.1.2.tar.gz.

File metadata

  • Download URL: pmgwidgets-0.1.2.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for pmgwidgets-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7cd42970a075d39b58d13a085c20ce3cd73f9678187ea79751b8ca09c22d5ef2
MD5 97775885b7b830cd4709da66243c0ea2
BLAKE2b-256 af08bedc876012922822f4869dc50c065a9daa87cb959c490cb0c20216e43c36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page