From e94b068977051f444efb3f96a0144e1b2c8ca37f Mon Sep 17 00:00:00 2001 From: D Herring Date: Mon, 28 Jun 2010 01:05:11 -0400 Subject: [PATCH] treeview fixes and improvements --- ltk.lisp | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ltk.lisp b/ltk.lisp index 7fb36be..71bb6f1 100644 --- a/ltk.lisp +++ b/ltk.lisp @@ -2668,13 +2668,15 @@ set y [winfo y ~a] option value rest)) (defgeneric treeview-delete (tree items)) -(defmethod treeview-delete ((tree treeview) items) +(defmethod treeview-delete ((tree treeview) item) + (format-wish "~a delete {~a}" (widget-path tree) item)) +(defmethod treeview-delete ((tree treeview) (items cons)) (format-wish "~a delete {~{~a~^ ~}}" (widget-path tree) items)) (defgeneric treeview-exists (tree item)) (defmethod treeview-exists ((tree treeview) item) - (format-wish "~a exists ~a" (widget-path tree) item) - (equal (read-data) 1)) + (format-wish "senddata [~a exists ~a]" (widget-path tree) item) + (= (read-data) 1)) (defgeneric treeview-focus (tree)) (defmethod treeview-focus ((tree treeview)) @@ -2729,15 +2731,15 @@ set y [winfo y ~a] |# id) -(defun treeview-item (tree column &rest options) +(defun treeview-item (tree item &rest options) "Query or modify the options for the specified item." (cond ((second options) ;; modify (format-wish "~a item ~a~{ -~(~a~) ~/ltk::tk-princ/~}" - (widget-path tree) column options)) + (widget-path tree) item options)) (t ;; query (format-wish "senddatastring [~a item ~a ~@[ -~(~a~)~]]" - (widget-path tree) column (car options)) + (widget-path tree) item (car options)) (read-data)))) (defun treeview-column (tree column &rest options) -- 1.7.1