new_contents: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  # @Author: mcxiaoke
  # @Date:   2015-08-08 17:17:39
  
  import Tkinter
  #import ttk
  from Tkinter import *
  #from ttk import *
  
  root = Tkinter.Tk()
  '''
  ttk.Style().configure("TButton", padding=6, relief="flat",
     background="#ccc")
  
  btn = ttk.Button(text="Sample")
  btn.pack()
  
  root.mainloop()
  '''
  
  '''
  style = ttk.Style()
  style.map("C.TButton",
      foreground=[('pressed', 'red'), ('active', 'blue')],
      background=[('pressed', '!disabled', 'black'), ('active', 'white')]
      )
  
  colored_btn = ttk.Button(text="Test", style="C.TButton").pack()
  
  print ttk.Style().lookup("TButton", "font")
  
  root.mainloop()
  '''
  
  '''
  style = ttk.Style()
  style.layout("TMenubutton", [
     ("Menubutton.background", None),
     ("Menubutton.button", {"children":
         [("Menubutton.focus", {"children":
             [("Menubutton.padding", {"children":
                 [("Menubutton.label", {"side": "left", "expand": 1})]
             })]
         })]
     }),
  ])
  
  mbtn = ttk.Menubutton(text='Text')
  mbtn.pack()
  root.mainloop()
  '''
  
  '''
  style = ttk.Style()
  print style.theme_names()
  style.theme_settings("default", {
     "TCombobox": {
         "configure": {"padding": 5},
         "map": {
             "background": [("active", "green2"),
                            ("!disabled", "green4")],
             "fieldbackground": [("!disabled", "green3")],
             "foreground": [("focus", "OliveDrab1"),
                            ("!disabled", "OliveDrab2")]
         }
  
  
  '''
  
  
  class Application(Frame):
      def say_hi(self):
          print "hi there, everyone!"
  
      def createWidgets(self):
          self.QUIT = Button(self)
          self.QUIT["text"] = "QUIT"
          self.QUIT["fg"]   = "red"
          self.QUIT["command"] =  self.quit
  
          self.QUIT.pack({"side": "left"})
  
          self.hi_there = Button(self)
          self.hi_there["text"] = "Hello",
          self.hi_there["command"] = self.say_hi
  
          self.hi_there.pack({"side": "left"})
  
      def __init__(self, master=None):
          Frame.__init__(self, master)
          self.pack()
          self.createWidgets()
  
  class App(Frame):
      def __init__(self, master=None):
          Frame.__init__(self, master)
          self.pack()
  
          self.entrythingy = Entry()
          self.entrythingy.pack()
  
          # here is the application variable
          self.contents = StringVar()
          # set it to some value
          self.contents.set("this is a variable")
          # tell the entry widget to watch this variable
          self.entrythingy["textvariable"] = self.contents
  
          # and here we get a callback when the user hits return.
          # we will have the program print out the value of the
          # application variable when the user hits return
          self.entrythingy.bind('<Key-Return>',
                                self.print_contents)
  
      def print_contents(self, event):
          print "hi. contents of entry is now ---->", \
                self.contents.get()
  
  root = Tk()
  app = App(master=root)
  app.master.title("Tkinter Demo")
  app.master.minsize(320,240)
  app.master.maxsize(800,600)
  print root.config()
  app.mainloop()
  root.destroy()
  
subject: add tk demo