home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / plplot / plplot_2 / drivers / tk / PLXWin.tcl < prev    next >
Encoding:
Text File  |  1994-06-10  |  2.1 KB  |  77 lines

  1. # PLXWin.tcl
  2. # Geoffrey Furnish
  3. # 10 June 1994
  4. #
  5. # @> [incr Tcl] interface to PLplot
  6. #
  7. # $Id: PLXWin.tcl,v 1.1 1994/06/10 20:43:57 furnish Exp $
  8. #
  9. # $Log: PLXWin.tcl,v $
  10. # Revision 1.1  1994/06/10  20:43:57  furnish
  11. # New extended plframe itcl widget.
  12. #
  13. ###############################################################################
  14.  
  15. itcl_class PLXWin {
  16.     inherit PLWin
  17.  
  18.     constructor {config} {
  19.  
  20.     PLWin::constructor
  21.  
  22.     #puts "running PLXWin ctor"
  23.  
  24.     # The following code copied over from plxframe in
  25.     # plwidget.tcl.  Now if I could just get Maurice to forget
  26.     # aobut non itcl stuff altogether ...
  27.  
  28.     set client {}
  29.  
  30.     # Make frame for top row widgets.
  31.     # plframe widget must already have been created (the plframe
  32.     # is queried for a list of the valid output devices for page
  33.     # dumps).
  34.  
  35.     plw_create_TopRow $this $client
  36.     pack append $this $this.ftop {top fill}
  37.  
  38.     # Initialize plplot widget
  39.     # Enable keyboard traversal when widget has the input focus.
  40.     # Also grab the initial input focus.
  41.  
  42.     tk_bindForTraversal $this.plwin
  43.     focus $this.plwin
  44.  
  45.     # Bindings
  46.     #
  47.     # Note: it is necessary here to protect the $client variable
  48.     # from becoming two tokens if it has embedded spaces, such as
  49.     # occurs when you have multiple copies running.  The [list
  50.     # $client] construct will enclose $client with a pair of
  51.     # braces if necessary (can't do it directly since braces
  52.     # prevent variable expansion).  The reason this is necessary
  53.     # is because binding the command to a key causes it to be
  54.     # parsed by the interpreter twice -- once during the bind and
  55.     # once during its execution.
  56.  
  57.     bind $this.plwin <Any-KeyPress> \
  58.         "key_filter $this [list $client] %K %N %A 0 0"
  59.     
  60.     bind $this.plwin <Shift-KeyPress> \
  61.         "key_filter $this [list $client] %K %N %A 1 0"
  62.  
  63.     bind $this.plwin <Control-KeyPress> \
  64.         "key_filter $this [list $client] %K %N %A 0 1"
  65.  
  66.     bind $this.plwin <Shift-Control-KeyPress> \
  67.         "key_filter $this [list $client] %K %N %A 1 1"
  68.  
  69.     bind $this.plwin <Any-ButtonPress> \
  70.         "plw_user_mouse $this [list $client] %b %s %x %y"
  71.  
  72.     bind $this.plwin <Any-Enter> \
  73.         "focus $this.plwin"
  74.  
  75.     }
  76. }
  77.