addTextColumn view name =
do
col <- treeViewColumnNew
rend <- cellRendererTextNew
treeViewColumnSetTitle col name
treeViewColumnPackStart col rend True
treeViewColumnSetExpand col True
treeViewAppendColumn view col
prepareTreeView view =
do
addTextColumn view "column1"
addTextColumn view "column2"
--adding data here
Then I try to add some data, and there are problems. I tried these:
--variant 1 (data TRow = TRow {one::String, two::String}
model <- listStoreNew ([] :: [TRow])
listStoreAppend model $ TRow { one = "Foo", two = "Boo" }
treeViewSetModel view model
--variant 2
model <- listStoreNew ([] :: [[String]])
listStoreAppend model ["foo","boo"]
treeViewSetModel view model
--variant 3
model <- listStoreNew ([] :: [(String, String)])
listStoreAppend model ("foo", "boo")
treeViewSetModel view model
But in all cases I see the table with column header and one blank row inserted. Any help will be appreciated.