I am trying to work with data sources and outline views for the first time…
I have the following gui:
The window is named frmMain, the scroll view which contains the outline view is called “scroll”, the outline view is called “outFiles” and it has a single column called “colFiles”
I have the following code:
on launched theObject
set dsFiles to make new data source at end of data sources with properties {name:"dsFiles"}
tell dsFiles
make new data column at end of data columns with properties {name:"colFiles"}
end tell
set rootList to {{colFiles:"build/"}, {colFiles:"__MACOSX/"}, {colFiles:"English.lproj/"}, {colFiles:"main.m"}, {colFiles:"Simple Outline.applescript"}, {colFiles:"Simple Outline.pbproj/"}}
append dsFiles with rootList
set data source of outline view "outFiles" of scroll view "scroll" of window "frmMain" to dsFiles
set update views of data source of outline view "outFiles" of scroll view "scroll" of window "frmMain" to true
set blah to contents of every data cell of every data row of data source of outline view "outFiles" of scroll view "scroll" of window "frmMain"
log blah
--set parentItem to make new data item at end of data items of dsFiles
--set contents of data cell "colFiles" of parentItem to "Test"
end launched
Why does nothing show up in the outline view?
the result of the log is:
{{“”}, {“”}, {“”}, {“”}, {“”}, {“”}}
if I replace the list with:
set rootList to {{"build/"}, {"__MACOSX/"}, {"English.lproj/"}, {"main.m"}, {"Simple Outline.applescript"}, {"Simple Outline.pbproj/"}}
still nothing shows up in the outline view, but this time the result of the log is:
{{“build/”}, {“__MACOSX/”}, {“English.lproj/”}, {“main.m”}, {“Simple Outline.applescript”}, {“Simple Outline.pbproj/”}}
if I replace the list with:
set rootList to {"build/", "__MACOSX/", "English.lproj/", "main.m", "Simple Outline.applescript", "Simple Outline.pbproj/"}
still nothing shows up in the outline view and I still get the same result as last time:
{{“build/”}, {“__MACOSX/”}, {“English.lproj/”}, {“main.m”}, {“Simple Outline.applescript”}, {“Simple Outline.pbproj/”}}
Finally, if I uncomment the last two lines, I do get something in the outline view.
Does anyone have any ideas?
Thanks in advance!
Ben