:multiple selection mode of tree view selection

Chisheng Huang <[email protected]> Sun, 8 Jul 2007 22:59:47 -0700 (PDT)
Newsgroups gmane.lisp.clg.devel
Message-ID <[email protected]>
Hi Espen,

The following code was adapted from the "list" example in testgtk.lisp.
The selection mode of the tree view is set to :MULTIPLE; however, no
matter how I click the rows in the tree view, there is only one row 
selected at any one time.  This is odd and contrary to my expection.
I ran the testgtk that came with the gtk+-2.10.13 source code and its 
"list" example allows multiple rows to be selected at the same time.
Also, calling GTK:TREE-SELECTION-MODE will generate a segmentation
violation.  Could you please look into these 2 problems?

Best wishes,

-cph


(defvar *tree*)
(let* ((store (make-instance 'gtk:list-store 
                             :column-types '(integer)
                             :column-names '(:foo)))
       (tree (make-instance 'gtk:tree-view :model store)))
  (setf *tree* tree)
  (loop with iter = (make-instance 'gtk:tree-iter)
        for i from 1 to 200
        do (gtk:list-store-append store (vector i) iter))
    
  (let ((column (make-instance 'gtk:tree-view-column :title "Column 1"))
        (cell (make-instance 'gtk:cell-renderer-text)))
    (gtk:cell-layout-pack column cell :expand t)
    (gtk:cell-layout-add-attribute column cell 'text
                                   (gtk:tree-model-column-index store :foo))
    (gtk:tree-view-append-column tree column))      
    
  ;; multiple selection
  (setf (gtk:tree-selection-mode (gtk:tree-view-selection tree)) :multiple)

  (gtk:widget-show-all
   (make-instance 'gtk:window
                  :default-width 256 :default-height 400
                  :child (make-instance 'gtk:scrolled-window 
                                        :child tree
                                        :hscrollbar-policy :automatic))))

(gtk:tree-selection-mode (gtk:tree-view-selection *tree*))

Error in function UNIX::SIGSEGV-HANDLER:
   Segmentation Violation at #x59964523.
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [ABORT] Abort SLIME compilation.
 1: [ABORT] Return to SLIME's top level.
 2: [ABORT] Return to Top-Level.

Backtrace:
  0: (UNIX::SIGSEGV-HANDLER #<#1=unused-arg>
                            #<#1#>
                            #.(SYSTEM:INT-SAP #x3FFFC1F8))
  1: (UNIX::SIGSEGV-HANDLER 3
                            #<#1=unused-arg>
                            #<#1#>
                            #.(SYSTEM:INT-SAP #x3FFFC1F8))[:EXTERNAL]
  2: ("call_into_lisp+#x8C [#x8054A5C] /usr/local/cmucl/bin/lisp")
  3: ("funcall3+#x29 [#x805486B] /usr/local/cmucl/bin/lisp")
  4: ("interrupt_handle_now+#xF0 [#x80504CF] /usr/local/cmucl/bin/lisp")
  5: ("NIL+#x805509C [#x805509C] /usr/local/cmucl/bin/lisp")
  6: ("NIL+#x80550D4 [#x80550D4] /usr/local/cmucl/bin/lisp")
  7: (GFFI:REF-POINTER #.(SYSTEM:INT-SAP #x00000003) 0)
  8: (GLIB::%TYPE-NUMBER-OF-GINSTANCE #.(SYSTEM:INT-SAP #x00000003))
  9: ((METHOD GFFI:MAKE-PROXY-INSTANCE (:AROUND) (GLIB:GINSTANCE-CLASS T))
      #<unused-arg>
      #S(PCL::FAST-METHOD-CALL
           :FUNCTION #<Function (METHOD GFFI:MAKE-PROXY-INSTANCE NIL
                                 (GLIB:GOBJECT-CLASS T))
                       {5937CB79}>
           :PV-CELL (#(22) . #())
           :NEXT-METHOD-CALL #S(PCL::FAST-METHOD-CALL
                                  :FUNCTION #<Function (METHOD
                                                        GFFI:MAKE-PROXY-INSTANCE ..)>)))
 10: (GFFI:ENSURE-PROXY-INSTANCE GTK:TREE-VIEW
                                 #.(SYSTEM:INT-SAP #x00000003))
 11: ("DEFUN MKBINDING" #.(SYSTEM:INT-SAP #x081F72C0))
 12: ("DEFMETHOD COMPUTE-SLOT-READER-FUNCTION AROUND (EFFECTIVE-VIRTUAL-SLOT-DEFINITION)"
      #<GTK:TREE-SELECTION at 0x81F72C0>)
 13: (C::DO-CALL #<Code Object {282D4D2F}> 6 7 4 ...)
 14: (C::SUB-COMPILE-TOP-LEVEL-LAMBDAS NIL T)
 15: (C::COMPILE-TOP-LEVEL-LAMBDAS NIL T)
 16: ((FLET #:G0
        C::SUB-COMPILE-FILE))
 17: (C::SUB-COMPILE-FILE #<Source-Info>
                          (:EMACS-BUFFER "g2-testing.lisp"
                           :EMACS-BUFFER-OFFSET 18904 :EMACS-BUFFER-STRING
                           ...))
 18: (C::SUB-COMPILE-FILE 2
                          #<Source-Info>
                          (:EMACS-BUFFER "g2-testing.lisp"
                           :EMACS-BUFFER-OFFSET 18904 :EMACS-BUFFER-STRING
                           ...))[:EXTERNAL]
 19: (EXTENSIONS:COMPILE-FROM-STREAM #<String-Input Stream>
                                     :ERROR-STREAM NIL
                                     :TRACE-STREAM ...)
 20: ("DEFIMPLEMENTATION SWANK-COMPILE-STRING")


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/