(use goo)
(use samurui/samurui)
(use samurui/gtk.swig)
(use samurui/starburst)

(dc <simple-app> (<any>))

;; There is no need to actually wrap a string.  Just pretend this is a more complicated class that
;;  does something of value.
(dc <str-hold> (<any>))
(iprop <str-hold>  da-str <str> "DaString")

(dm hold (s|<str>)
  (def o (new <str-hold>))
  (set (da-str o) s)
  o
  )

(dm to-str (h|<str-hold> => <str>)
  (da-str h)
  )

;; Ditto on numbers.  No need to wrap, but pretend there's other stuff going on.
(dc <int-hold> (<any>))
(ipropc <int-hold> da-int <int> "DaInt" (num-constraint 0 100))

(dm hold (i|<int>)
  (def o (new <int-hold>))
  (set (da-int o) i)
  o
  )

(dm to-str (h|<int-hold> => <str>)
  (to-str (da-int h))
  )

(iprop <simple-app> tree-nodes <visi-col> "Tree Nodes")

(dv my-app (new <simple-app>))

(set (tree-nodes my-app) (visi-wrap-col 
                          (vec (hold "Apples")
                               (hold "Bananas")
                               (hold "Pears" )
                               (vec (hold 1)
                                    (hold 2)
                                    (hold 3))
                               (vec (vec (hold "Spaceships")
                                         (hold "Monkeys")
                                         (hold "Dogs")
                                         (vec (hold "Enterprise")
                                              (hold "Endeavor")
                                              (hold "Challenger"))
                                         (vec (hold "Soup")
                                              (hold "Crackers"))
                                         (hold "Zoos"))
                                    (hold "Kings")
                                    (hold "Queens")
                                    (hold "Pawns"))
                              )))


(iview <int-hold>
        "Current Int"
        da-int
        )

(iview <str-hold>
        "Current String"
        da-str
        )

(iview <simple-app>
        (attr (columns
               (master bob (attr tree-nodes fill))
               (slave bob)
               ) fill)
        )

(samurui-init)

(present my-app)

(samurui-go)