Package: gtk
Function gtk:tree-view-insert-column-with-data-func
Lambda Listgtk:tree-view-insert-column-with-data-func (view pos title renderer func) ArgumentsReturn ValueThe integer for the number of columns in view after insertion. Details
Convenience function that inserts a new column into the tree view with the given cell renderer and a gtk:tree-cell-data-func callback function
to set cell renderer attributes (normally using data from the model). See also the gtk:tree-view-column-set-cell-data-func and gtk:tree-view-column-pack-start functions. If the tree view has the fixed-height-mode property enabled, then the new column will have its sizing property set to be the :fixed value. Examples
(defun age-cell-data-sortable (column renderer model iter)
(declare (ignore column))
(let ((year (sixth (multiple-value-list (get-decoded-time))))
(text nil)
(value (gtk:tree-model-value model iter colyearborn)))
(if (and (< value year) (> value 0))
(progn
(setf text (format nil "~a years old" (- year value)))
(setf (gtk:cell-renderer-text-foreground-set renderer) nil))
(progn
(setf text "age unknown")
(setf (gtk:cell-renderer-text-foreground renderer) "Red")))
(setf (gtk:cell-renderer-text-text renderer) text))) | See also |
2025-07-15