home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / tcl / 1214 < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.7 KB  |  48 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!gmd.de!borneo.gmd.de!richard
  3. From: richard@borneo.gmd.de (Richard Czech)
  4. Subject: bind: How to select using Button-3
  5. Message-ID: <1992Aug18.123400.3968@gmd.de>
  6. Sender: news@gmd.de (USENET News)
  7. Nntp-Posting-Host: hawaii
  8. Reply-To: richard@borneo.gmd.de
  9. Organization: GMD, German National Research Center for Computer Science
  10. Date: Tue, 18 Aug 1992 12:34:00 GMT
  11. Lines: 35
  12.  
  13.  
  14. Hi!
  15.  
  16. I have a Tcl/Tk application in which I want to have different bindings
  17. for Button-1 and Button-3 in several listboxes as follows:
  18.  
  19.   ButtonPress-1:    select the element in the listbox
  20.   ButtonRelease-1:    perform action 1
  21.  
  22.   ButtonPress-3:    select the element in the listbox
  23.   ButtonRelease-3:    perform action 2
  24.  
  25. It works fine for Button-1, because the selection of elements in
  26. listboxes is predefined for Button-1. The manual page for listbox
  27. says:
  28.  
  29.   DEFAULT BINDINGS
  30.      Tk automatically creates class bindings for  listboxes  that
  31.      give them the following default behavior: 
  32.  
  33.      [1]
  34.           When  button  1  is pressed over a listbox, the element
  35.           underneath the mouse cursor is selected.  The mouse can
  36.           be dragged to select a range of elements.
  37.  
  38.  
  39. But how is this done? Can I define the same functionality for
  40. Button-3 using the bind command?
  41.  
  42. ----------------------------------------------------------------------
  43.         Richard Czech                        e-mail:      czech@gmd.de
  44.          GMD-I5-FIT
  45.         P.O.Box 13 16                        phone: (+49) 2241 14 2039
  46. D-5205 St. Augustin 1, Germany               fax:   (+49) 2241 14 2342
  47. ----------------------------------------------------------------------
  48.