         (do
           (add-tab-with-name-icon-tooltip frame (get-widget pane)
             "Contexts" nil "View and edit contexts")
-          (dosync 
+          (dosync-wait 
             (ref-set context-workspace-tree workspace-tree)
             (ref-set context-pane pane)
-            (ref-set +debug+ right)) ))) ) )
+            (ref-set +debug+ right)) 
+          (+debug-hook+)))) ) )
 
 (defn plug-unload-hook
   "Unloads the context-editor plugin.

    clojure.contrib.swing-utils
    conexp.gui.editors.util
    conexp.fca
    ))

;;
;;

   editable context structure.

  Parameters:
    context-in     _context or editable context"
  ([context-in]
    (let [ ctx (get-context context-in)
           obj (objects ctx)
           attr (attributes ctx)
           inc (incidence ctx)
           obj-map (map-to-unique-strings obj)
           attr-map (map-to-unique-strings attr)
           compatible-obj (map obj-map obj)
           compatible-attr (map attr-map attr)
           compatible-inc  (map (fn [x] [(obj-map (first x)) 
                                          (attr-map (second x))]) inc)
           compatible-ctx (make-context compatible-obj
                            compatible-attr compatible-inc)
           attr-range (range 1 (+ 1 (count compatible-attr)))
           assoc-widgets (ref #{})
           context (ref compatible-ctx)
           editable-ctx 
           {:editable-context 1
           :context context
           :associated-widgets assoc-widgets
           :attribute-columns (ref (conj 
                                     (zipmap compatible-attr attr-range)
                                     (zipmap attr-range compatible-attr)))

           :remove-widget-
           (fn-doc "Removes a widget from associated widgets.
  Parameters:
    widget     _widget to be removed"
             [widget]
             (dosync-wait (commute assoc-widgets disj widget)))

           :add-widget-
           (fn-doc "Adds a widget to associated widgets and updates the control
  accordingly.

  Parameters:
    widget    _context-widget to be added"
             [widget]
             (do
               (dosync-wait (commute assoc-widgets conj widget))
               (let [ table (widget :table)
                      ctx @context 
                      fca-ctx (get-context ctx)]
                 (do
                   (!! table :set-column-count 
                     (+ 1 (count (attributes fca-ctx))))
                   (!! table :set-row-count
                     (+ 1 (count (objects fca-ctx))))
                   ))))
          }]
        editable-ctx))
 ([]
   (make-editable-context (make-context [] [] []))))

(def ctx (conexp.fca/make-context ["a" "b" "c"] [1 2 3] [["a" 1] ["c" 3]]))
(def ectx (make-editable-context ctx))
(def gui conexp/gui)

(def context-pane (ref nil))
(def context-workspace (ref nil))
(def context-workspace-tree (ref nil))
(def +debug+ (ref nil))
(defn +debug-hook+ []
  (!! @+debug+ :associate-context ectx))

(defn update-workspace-tree
  "Updates the data displayed in the current workspace tree
