gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
974B

  1. # dialog1.tcl --
  2. #
  3. # This demonstration script creates a dialog box with a local grab.
  4. interp create child
  5. load {} Tk child
  6. child eval {
  7. wm title . child
  8. wm geometry . +700+30
  9. pack [text .t -width 30 -height 10]
  10. }
  11. after idle {.dialog1.msg configure -wraplength 4i}
  12. set i [tk_dialog .dialog1 "Dialog with local grab" {This is a modal dialog box. It uses Tk's "grab" command to create a "local grab" on the dialog box. The grab prevents any mouse or keyboard events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications. For example, you should be able to edit text in the window named "child" which was created by a child interpreter.} \
  13. info 0 OK Cancel {Show Code}]
  14. switch $i {
  15. 0 {puts "You pressed OK"}
  16. 1 {puts "You pressed Cancel"}
  17. 2 {showCode .dialog1}
  18. }
  19. if {[interp exists child]} {
  20. interp delete child
  21. }
上海开阖软件有限公司 沪ICP备12045867号-1