Posted to tcl by patthoyts at Sat Nov 03 00:08:52 GMT 2007view raw

  1. package require Tk
  2. package require tile 0.8
  3.  
  4. catch {
  5. ttk::style element create plain.background from default
  6. }
  7.  
  8. ttk::style layout Plain.TEntry {
  9. Entry.field -sticky nswe -border 0 -children {
  10. Entry.border -sticky nswe -border 1 -children {
  11. Entry.padding -sticky nswe -children {
  12. Entry.plain.background -sticky nswe -children {
  13. Entry.textarea -sticky nswe
  14. }
  15. }
  16. }
  17. }
  18. }
  19.  
  20. ttk::style configure Plain.TEntry -background LightSteelBlue -padding 0 -borderwidth 2
  21.  
  22. proc Test {} {
  23. ttk::entry .e -style Plain.TEntry
  24. ttk::entry .e2
  25. grid .e -pady 2 -padx 2
  26. grid .e2 -pady 2 -padx 2
  27. }
  28.  
  29. Test
  30. bind . <Control-F2> {console show}
  31. tkwait window .