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.tar.gz (24.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pmgwidgets-0.1.tar.gz
  • Upload date:
  • Size: 24.1 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.tar.gz
Algorithm Hash digest
SHA256 884861747d0b4ba18a7818c55c62165eede5b933f5aa5fa7f63c97f55da991f2
MD5 5ff25e2d2c64baf3a606923b0788e444
BLAKE2b-256 664348f817bd2dc1b352cb1b427c2aaa2359d2fcd634bb3ce32112cf10685ea0

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