Posted to tcl by h1rag4mi at Tue Oct 22 10:24:51 GMT 2019view raw

  1. toplevel .t
  2. frame .t.myFrame1 -background red -relief ridge -borderwidth 8 -padx 10 -pady 10 -height 100 -width 100
  3. button .t.myFrame1.b1 -text "Puts .t.myFrame1" -command {puts ".t.myFrame1"}
  4. button .t.myFrame1.b2 -text "grab .t" -command {grab .t}
  5. button .t.myFrame1.b3 -text "grab -global .t" -command {grab -global .t}
  6. entry .t.myFrame1.e1 -width 20
  7. button .t.b1 -text "Puts .t" -command {puts ".t"}
  8. button .t.b2 -text "grab .t.myFrame1" -command {grab .t.myFrame1}
  9. button .t.b3 -text "grab -global .t.myFrame1" -command {grab -global .t.myFrame1}
  10. entry .t.e1 -width 20
  11.  
  12. pack .t.myFrame1
  13. pack .t.myFrame1.b1
  14. pack .t.myFrame1.b2
  15. pack .t.myFrame1.b3
  16. pack .t.myFrame1.e1
  17.  
  18. pack .t.b1
  19. pack .t.b2
  20. pack .t.b3
  21. pack .t.e1