找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 4786|回复: 0

[求助] Tkinter的按钮设置有谁清楚不

9

主题

28

帖子

28

积分

贫民

积分
28
pan 发表于 2017-5-24 21:01:07 | 显示全部楼层 |阅读模式
1威望
小弟最近在学python 自带的GUI模块Tkinter,在学习使用button的时候遇到一些问题,网上查不到资料,只能请教论坛的大神了~button的语法:w = Button ( master, option=value, ... )
参数列表
OptionDescription
activebackgroundBackground color when the button is under the cursor.
activeforegroundForeground color when the button is under the cursor.
bdBorder width in pixels. Default is 2.
bgNormal background color.
commandFunction or method to be called when the button is clicked.
fgNormal foreground (text) color.
fontText font to be used for the button's label.
heightHeight of the button in text lines (for textual buttons) or pixels (for images).
highlightcolorThe color of the focus highlight when the widget has focus.
imageImage to be displayed on the button (instead of text).
justifyHow to show multiple text lines: LEFT to left-justify each line; CENTER to center them; or RIGHT to right-justify.
padxAdditional padding left and right of the text.
padyAdditional padding above and below the text.
reliefRelief specifies the type of the border. Some of the values are SUNKEN, RAISED, GROOVE, and RIDGE.
stateSet this option to DISABLED to gray out the button and make it unresponsive. Has the value ACTIVE when the mouse is over it. Default is NORMAL.
underlineDefault is -1, meaning that no character of the text on the button will be underlined. If nonnegative, the corresponding text character will be underlined.
widthWidth of the button in letters (if displaying text) or pixels (if displaying an image).
wraplengthIf this value is set to a positive number, the text lines will be wrapped to fit within this length.
1、[size=14.6667px]highlightcolor这个参数是干嘛的?如何设置?
[size=14.6667px]2、[size=14.6667px]image这个参数怎么设置?直接赋值路径吗?
[size=14.6667px]3、relief这个参数怎么设置?
[size=14.6667px]4、state参数怎么设置?

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表