From hathtk@hes-fi.kone.com  Sat May 14 07:17:01 1994
Posted-Date: Sat, 14 May 1994 13:16:39 +0200 (EET)
Received-Date: Sat, 14 May 94 07:17:01 -0400
Received: from doris by tele.fi; id OAA10270; Sat, 14 May 1994 14:16:56 +0300 
Received: from hesfi2.hes-fi.kone.com by doris with SMTP
	(8.3/15.6) id OAA06360; Sat, 14 May 1994 14:19:03 +0200
Message-Id: <199405141219.OAA06360@doris>
Received: from hesfi1.hes-fi.kone.com by hesfi2.hes-fi.kone.com with SMTP
	(1.38.193.4/15.6) id AA19246; Sat, 14 May 1994 14:16:02 +0300
Received: by hesfi1.hes-fi.kone.com
	(1.37.109.8/15.6) id AA11769; Sat, 14 May 1994 13:16:40 +0200
From: Heikki Karhunen <hathtk@hes-fi.kone.com>
Subject: Tix 3.6 and multiple selections for Tk listbox
To: ioi@graphics.cis.upenn.edu
Date: Sat, 14 May 1994 13:16:39 +0200 (EET)
X-Witty-Comment: 
	Rotten wood can not be carved - Confucius (Analects, Book 5, Ch. 9)
X-Mailer: ELM [version 2.4 PL22]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
Content-Length: 3118      
Status: RO

Greetings again...

As it happens, I have a need for multiple selections with Tk listbox
widgets. I have Mark Ewing's patch for Tk 3.6, but Tix was not awar of
this. After some assembly, I made my instance of Tix aware of multiple
selections similarily as in Tk's listbox widget.

The option used is as follows:

    Name:           multipleSelections
    Class:          MultipleSelections
    Command-Line Switch:           -multipleselections

         Specifies selection behaviour for the listbox.  If the value is 0
         (the  default),  only one contiguous selection may be made in the
         listbox.  If  the  value  is  non-zero,  multiple  non-contiguous
         selections may be made.                                            

I have added the diffs for library/SLlistBox.tcl for your information.

	HTK, the professional idiot...
-- 
/-----------------------------+-----------------------------------------\
| Heikki.Karhunen@helsinki.fi | There is always a job for a theoretical |
| Heikki.Karhunen@kone.com    | physicist -- at least in theory.        |
\-----------------------------+-----------------------------------------/

========== 8< ========== 8< ========== 8< ========== 8< ==========
*** SListBox.tcl.orig	Sat May 14 14:10:12 1994
--- SListBox.tcl	Sat May 14 14:07:39 1994
***************
*** 18,23 ****
--- 18,24 ----
  			       -background -bg
  			       -foreground -fg
  			       -font
+ 			       -multipleselections
  			       -geom -geometry -listboxbg
  			       -scrollbarbg -scrollbarfg
  			      }
***************
*** 34,40 ****
      set tixSlb(-scrollbarfg)  {-scrollbarfg scrollbarFg ScrollbarFg #ffe4c4}
      set tixSlb(-scrollbar)    {-scrollbar scrollbar Scrollbar both}
      set tixSlb(-font)         {-font font Font \
! 	                     "-*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*"}
  
      # ALIASES
      set tixSlb(-bg)           {= -background}
--- 35,43 ----
      set tixSlb(-scrollbarfg)  {-scrollbarfg scrollbarFg ScrollbarFg #ffe4c4}
      set tixSlb(-scrollbar)    {-scrollbar scrollbar Scrollbar both}
      set tixSlb(-font)         {-font font Font \
! 	                     "-*-helvetica-medium-r-normal-*-14-*-*-*-*-*-iso8859-1"}
!     set tixSlb(-multipleselections) {-multipleselections multipleSelections \
! 	MultipleSelections 0}
  
      # ALIASES
      set tixSlb(-bg)           {= -background}
***************
*** 82,87 ****
--- 85,91 ----
  
      listbox $w.lb1 \
  	-exportselection false \
+ 	-multipleselections $data(-multipleselections) \
  	-xscrollcommand "tixSlb::MonitorSize $w width $w.sb1"  \
  	-yscrollcommand "tixSlb::MonitorSize $w height $w.sb2" \
  	-font $data(-font) \
***************
*** 227,232 ****
--- 231,243 ----
  
      $data(listbox) config -geometry $arg
  }
+ 
+ proc tixSlb::config-multipleselections {w arg} {
+     upvar #0 $w data
+ 
+     $data(listbox) config -multipleselections $arg
+ }
+ 
  #----------------------------------------------------------------------
  #                     WIDGET COMMANDS
  #----------------------------------------------------------------------

