- (let ((tree (make-instance 'tree-view :model store)))
- (let ((column (make-instance 'tree-view-column :title "Column 1"))
- (cell (make-instance 'cell-renderer-text)))
- (cell-layout-pack column cell)
- (cell-layout-add-attribute column cell 'text (column-index store :foo))
- (tree-view-append-column tree column))
-
- (let ((column (make-instance 'tree-view-column :title "Column 2"))
- (cell (make-instance 'cell-renderer-text :background "orange")))
- (cell-layout-pack column cell)
- (cell-layout-add-attribute column cell 'text (column-index store :bar))
- (tree-view-append-column tree column))
-
- (let ((column (make-instance 'tree-view-column :title "Column 3"))
- (cell (make-instance 'cell-renderer-text)))
- (cell-layout-pack column cell)
- (cell-layout-add-attribute column cell 'text (column-index store :baz))
- (tree-view-append-column tree column))
-
- (make-instance 'scrolled-window
- :parent dialog :child tree :show-all t :border-width 10
- :hscrollbar-policy :automatic))))
+ (make-instance 'v-box
+ :parent dialog :border-width 10 :spacing 10 :show-all t
+ :child (list
+ (make-instance 'h-box
+ :spacing 10
+ :child (make-instance 'button
+ :label "Remove Selection"
+ :signal (list 'clicked
+ #'(lambda ()
+ (let ((references
+ (mapcar
+ #'(lambda (path)
+ (make-instance 'tree-row-reference :model store :path path))
+ (tree-selection-get-selected-rows
+ (tree-view-selection tree)))))
+ (mapc
+ #'(lambda (reference)
+ (list-store-remove store reference))
+ references))))))
+ :expand nil)
+ :child (list
+ (make-instance 'h-box
+ :spacing 10
+ :child (make-instance 'check-button
+ :label "Show Headers" :active t
+ :signal (list 'toggled
+ #'(lambda (button)
+ (setf
+ (tree-view-headers-visible-p tree)
+ (toggle-button-active-p button)))
+ :object t))
+ :child (make-instance 'check-button
+ :label "Reorderable" :active nil
+ :signal (list 'toggled
+ #'(lambda (button)
+ (setf
+ (tree-view-reorderable-p tree)
+ (toggle-button-active-p button)))
+ :object t))
+ :child (list
+ (make-instance 'h-box
+ :child (make-instance 'label :label "Selection Mode: ")
+ :child (make-instance 'combo-box
+ :content '("Single" "Browse" "Multiple")
+ :active 0
+ :signal (list 'changed
+ #'(lambda (combo-box)
+ (setf
+ (tree-selection-mode
+ (tree-view-selection tree))
+ (svref
+ #(:single :browse :multiple)
+ (combo-box-active combo-box))))
+ :object t)))
+ :expand nil))
+ :expand nil)
+ :child (make-instance 'scrolled-window
+ :child tree :hscrollbar-policy :automatic))))