Paste: table headers

Author: jon
Mode: cvs-commit
Date: Sat, 20 Sep 2014 13:58:51
Plain Text |
jon@zik:~/factor$ diff -u /tmp/aze.txt work/test-voc/test-voc.factor 
--- /tmp/aze.txt	2014-09-20 15:54:52.621887357 +0200
+++ work/test-voc/test-voc.factor	2014-09-20 15:54:25.237888355 +0200
@@ -6,10 +6,13 @@
 M: trivial-renderer column-titles
     drop { "Text" }
     ;
+: <table-with-headers> ( table -- gadget )
+        [ viewport-column-header ] keep 2array <pile> 1 >>fill
+        swap add-gadgets { 50 50 } >>pref-dim ;
 : main ( -- )
     [
         { { "first line" } { "second line" } } <model>
-        trivial-renderer <table> "without scroller" open-window
+        trivial-renderer <table> <table-with-headers> "without scroller" open-window
 
         { { "first line" } { "second line" } } <model>
         trivial-renderer <table> <scroller> "with scroller" open-window

New Annotation

Summary:
Author:
Mode:
Body: