chiark / gitweb /
Bug fix
[clg] / gtk / gtktree.lisp
index 15c9a56dd8a67ef10532018737849f664274c7c9..e86546017c12cd93c4654937090db1e976c41fca 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: gtktree.lisp,v 1.21 2006-06-23 12:25:37 espen Exp $
+;; $Id: gtktree.lisp,v 1.23 2006-08-15 10:13:42 espen Exp $
 
 
 (in-package "GTK")
@@ -73,6 +73,14 @@ (defbinding cell-layout-clear-attributes () nil
   (cell cell-renderer))
 
 
+;;;; Cell Renderer
+
+(defmethod compute-signal-function ((gobject cell-renderer-toggle) (signal (eql 'toggled)) function object)
+  (declare (ignore gobject signal function object))
+  (let ((function (call-next-method)))
+    #'(lambda (object path)
+       (funcall function object (ensure-tree-path path)))))
+
 
 ;;;; List Store
 
@@ -308,6 +316,11 @@ (define-type-method destroy-function ((type tree-path) &key temp inlined)
   #'(lambda (location &optional (offset 0))
       (%tree-path-free (ref-pointer location offset))))
 
+(defun ensure-tree-path (path)
+  (etypecase path
+    (string (coerce (clg-utils:split-string path :delimiter #\:) 'vector))
+    (vector path)))
+
 
 (defbinding %tree-row-reference-new () pointer
   (model tree-model)