From: Dmitry Kalyanov Date: Mon, 25 Jan 2010 00:39:06 +0000 (+0300) Subject: Fix gtk-demo:demo's usage of text-tag-table X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1358bee22eca675fb53998de23b064008cdab1f4;p=cl-gtk2.git Fix gtk-demo:demo's usage of text-tag-table --- diff --git a/gtk/gtk.demo.lisp b/gtk/gtk.demo.lisp index 343b967..4d80b79 100644 --- a/gtk/gtk.demo.lisp +++ b/gtk/gtk.demo.lisp @@ -80,9 +80,17 @@ (:fn "Testing GtkUIManager" test-ui-manager) (:fn "GtkFontChooser" test-font-chooser))) +(defun clear-text-tag-table (table) + (let (tags) + (text-tag-table-foreach table + (lambda (tag) + (push tag tags))) + (iter (for tag in tags) + (text-tag-table-remove table tag)))) + (defun fill-demo-text-buffer (buffer text-view &optional (page 'index)) (declare (ignorable text-view)) - (setf (text-buffer-tag-table buffer) (make-instance 'text-tag-table)) + (clear-text-tag-table (text-buffer-tag-table buffer)) (setf (text-buffer-text buffer) "") (text-tag-table-add (text-buffer-tag-table buffer) (make-instance 'text-tag :name "bold" :weight 700)) (labels ((insert-text (text)