python tkinter图片为什么要设置全局变量_python – 为什么Tkinter画布要求宽度和高度增加4个像素?...

得到它了!

c = Tkinter.Canvas(width=100, height=100, highlightthickness=0)

>>> c.winfo_reqwidth()

100

我调试问题的方式也可能对有需要的人有用:

import pprint

pprint.pprint(c.configure())

{'background': ('background',

'background',

'Background',

'SystemButtonFace',

'SystemButtonFace'),

'bd': ('bd', 'borderWidth'),

'bg': ('bg', 'background'),

'borderwidth': ('borderwidth', 'borderWidth', 'BorderWidth', '0', '0'),

'closeenough': ('closeenough', 'closeEnough', 'CloseEnough', '1', '1.0'),

'confine': ('confine', 'confine', 'Confine', '1', '1'),

'cursor': ('cursor', 'cursor', 'Cursor', '', ''),

'height': ('height', 'height', 'Height', '7c', '100'),

'highlightbackground': ('highlightbackground',

'highlightBackground',

'HighlightBackground',

'SystemButtonFace',

'SystemButtonFace'),

'highlightcolor': ('highlightcolor',

'highlightColor',

'HighlightColor',

'SystemWindowFrame',

'SystemWindowFrame'),

'highlightthickness': ('highlightthickness',

'highlightThickness',

'HighlightThickness',

'2',

'0'),

'insertbackground': ('insertbackground',

'insertBackground',

'Foreground',

'SystemButtonText',

'SystemButtonText'),

'insertborderwidth': ('insertborderwidth',

'insertBorderWidth',

'BorderWidth',

'0',

'0'),

'insertofftime': ('insertofftime', 'insertOffTime', 'OffTime', '300', '300'),

'insertontime': ('insertontime', 'insertOnTime', 'OnTime', '600', '600'),

'insertwidth': ('insertwidth', 'insertWidth', 'InsertWidth', '2', '2'),

'offset': ('offset', 'offset', 'Offset', '0,0', '0,0'),

'relief': ('relief', 'relief', 'Relief', 'flat', 'flat'),

'scrollregion': ('scrollregion', 'scrollRegion', 'ScrollRegion', '', ''),

'selectbackground': ('selectbackground',

'selectBackground',

'Foreground',

'SystemHighlight',

'SystemHighlight'),

'selectborderwidth': ('selectborderwidth',

'selectBorderWidth',

'BorderWidth',

'1',

'1'),

'selectforeground': ('selectforeground',

'selectForeground',

'Background',

'SystemHighlightText',

'SystemHighlightText'),

'state': ('state', 'state', 'State', 'normal', 'normal'),

'takefocus': ('takefocus', 'takeFocus', 'TakeFocus', '', ''),

'width': ('width', 'width', 'Width', '10c', '100'),

'xscrollcommand': ('xscrollcommand',

'xScrollCommand',

'ScrollCommand',

'',

''),

'xscrollincrement': ('xscrollincrement',

'xScrollIncrement',

'ScrollIncrement',

'0',

'0'),

'yscrollcommand': ('yscrollcommand',

'yScrollCommand',

'ScrollCommand',

'',

''),

'yscrollincrement': ('yscrollincrement',

'yScrollIncrement',

'ScrollIncrement',

'0',

'0')}

因此,在查看完整的配置后,我猜测它是高亮或严密的参数.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值