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.

51 lines
1.6KB

  1. # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  2. #
  3. # $Id: DragDrop.tcl,v 1.3 2001/12/09 05:31:07 idiscovery Exp $
  4. #
  5. # Tix Demostration Program
  6. #
  7. # This sample program is structured in such a way so that it can be
  8. # executed from the Tix demo program "widget": it must have a
  9. # procedure called "RunSample". It should also have the "if" statment
  10. # at the end of this file so that it can be run as a standalone
  11. # program using tixwish.
  12. # This file demonstrates the Drag+Drop features in Tix. Drag+Drop is still
  13. # experimental in Tix. Please don't use. For your eyes only.
  14. #
  15. #
  16. proc RunSample {w} {
  17. text $w.d -height 5
  18. $w.d insert end {Quick and dirty example:
  19. click on any node on on the directory lists and drag. You can see the
  20. cursor change its shape. The "dropsite" of the directory lists will be
  21. highlighted when you drag the cursor accorss the directory nodes.
  22. Nothing will happen when you drop. }
  23. pack $w.d -padx 10 -pady 5
  24. tixDirList $w.d1; pack $w.d1 -fill both -padx 10 -pady 5 \
  25. -side left
  26. tixDirList $w.d2; pack $w.d2 -fill both -padx 10 -pady 5 \
  27. -side left
  28. button $w.b -text "Close" -command "destroy $w"
  29. pack $w.b -side left -anchor c -expand yes
  30. $w.d1 subwidget hlist config -selectmode dragdrop
  31. $w.d2 subwidget hlist config -selectmode dragdrop
  32. }
  33. # This "if" statement makes it possible to run this script file inside or
  34. # outside of the main demo program "widget".
  35. #
  36. if {![info exists tix_demo_running]} {
  37. wm withdraw .
  38. set w .demo
  39. toplevel $w; wm transient $w ""
  40. RunSample $w
  41. bind $w <Destroy> "exit"
  42. }
上海开阖软件有限公司 沪ICP备12045867号-1