data source question AND outline question

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

I’m working on a similar problem. Any help?
Other than apple’s example “outline”

Thanks Jaques

Last night I discarded all the lines concerning the data source, I also removed the labels in the record.
So now I’m displaying my simple outline (1-deep) just with a list of lists that I manipulate and then

set content of outlineView to myListOfLists

This works for my simple outline -

{"Luke", "default", {{"", "", "default", date, 1, 12.3, 61.5}}}, {"Luke Z", "defa44lt", {{"", "", "default", date, 1, 12.3, 61.5}, {"", "", "default", date, 1, {12.3, 61.5}}}}

The thing is, when I add a new row, the outline collapses and I have to find the row that is to be expanded.
The two empty entries ensure that the data is shown in the correct columns, now that I’m no longer using lables.

With table view and labels I also had some trouble especially when filtering. Something like the following would return false results:

set a to data rows of myDataSource of it whose content of data cell "myTag" is "the searched value"

Fortunately I was helped and learned that using the columns index rather than it’s identifier works fine in the above line.