example_7_3.py

来自「Python.Tkinter编程实例代码多多学习」· Python 代码 · 共 22 行

PY
22
字号
from Tkinter       import *
from GUICommon_7_2 import *

import string

class TestColors(Frame, GUICommon):
    def __init__(self, parent=None):

        Frame.__init__(self)
        self.base = "#848484"
        self.pack()
        self.set_colors()
        self.make_widgets()

    def make_widgets(self):
        for tag in ['VDBase', 'DBase', 'Base', 'LBase', 'VLBase']:
            Button(self, text=tag, bg=eval('self.%s' % string.lower(tag)), 
                     fg='white', command=self.quit).pack(side=LEFT)

if __name__ == '__main__':
    TestColors().mainloop()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?