     (fg/defcomponent button/button :o {:text ":o"})
     (fg/defcomponent button/button :p {:text ":p"})))
 
+(def text-model (textfield/create-multi-line-model
+                  (mapcat identity [["["] (mapv str layout-cfg) ["]"]])))
+
+(fg/defevolverfn :config-valid
+  (let [cfg-str (get-property [:this :scroll :content-pane :textfield] :text)]
+    (if cfg-str
+      (try ;For now, there is no better way to check config validity
+        (let [cfg (read-string cfg-str)
+              layout-cfg (flatgui.layout/coord-map-evolver
+                           (assoc (get-in (:root-container component) [:children :layoutdemo]) :layout cfg))]
+          (if layout-cfg true false))
+        (catch Exception e (do (println "Config invalid: " (.getMessage e)) false)))
+      false)))
+
+;;; Allow entering only what's releavant for this sample layout config
+(defn sample-only-text-suplier [component]
+  (let [key (textfield/textfield-dflt-text-suplier component)]
+    (if (#{"a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "m" "n" "o" "p"
+           " " "[" "]"
+           ":" "-" "|" "<" ">" "'" "."} key) key "")))
+
 (def layout-window
   (fg/defcomponent
     window/window
     :config
-    {:clip-size (m/defpoint 5.125 5.5)
+    {:clip-size (m/defpoint 3.5 3.5)
      :position-matrix (m/translation 0.25 0.25)
-     :text "Config"}
+     :text "Config"
+     :config-valid true
+     :layout [[[:scroll :-|]]
+              [[:validity-indicator :-]]
+              [[:apply :-]]]
+     :evolvers {:config-valid config-valid-evolver}}
 
     (fg/defcomponent
       scrollpanel/scrollpanel
       :scroll
-      {:clip-size (m/defpoint 4.875 4.375)
-       :position-matrix (m/translation 0.125 0.5)
-       :children {:content-pane (fg/defcomponent
+      {:children {:content-pane (fg/defcomponent
                                   scrollpanel/scrollpanelcontent
                                   :content-pane
                                   {:evolvers {:content-size (fg/accessorfn (get-property component [:this :textfield] :clip-size))


(fg/defevolverfn :layout
  (if (and
        (= (fg/get-reason) [:config :scroll :content-pane :textfield])
        (abtn/button-pressed? (get-property [:config :apply] :pressed-trigger)))
    (read-string (get-property [:config :scroll :content-pane :textfield] :text))
    old-layout))

    {:theme flatgui.theme/dark
     :clip-size (m/defpoint 40 20)
     :background (awt/color 9 17 26)

     ;; TODO this should be a part defroot probably
     :closed-focus-root true
