Page 1 of 1
datagrid on substack - no labels
Posted: Sat Dec 11, 2010 5:50 pm
by kwinkler
I have a problem where the column labels on a datagrid in a substack are missing. In this screenshot, the upper two windows are in LiveCode and the lower two windows are from the compiled application. Notice that the LiveCode window labeled "Data" looks fine, but the app version of the "Data" window is missing the column labels. Any idea how to get them back?

- Screen shot 2010-12-11 at 11.44.26 AM.png (226.67 KiB) Viewed 4821 times
Re: datagrid on substack - no labels
Posted: Sat Dec 11, 2010 6:51 pm
by kwinkler
Update-
This problem is somewhat platform dependent. On a PC, the executable shows the Var1 and Var2 columns labeled correctly, but the Time column still has no label.
Re: datagrid on substack - no labels
Posted: Sat Dec 11, 2010 7:13 pm
by kwinkler
Actually the problem is not platform dependent. The nature of the labels depends on whether or not the "Data" window is opened before or after the data is changed.
And therein may lie the heart of the problem, since the LiveCode hints state-

- Screen shot 2010-12-11 at 1.11.07 PM.png (19.21 KiB) Viewed 4812 times
Update 2-
Re: datagrid on substack - no labels
Posted: Sat Dec 11, 2010 7:58 pm
by kwinkler
and the solution is.........
Place the following code on the stack script of the main stack. This immediately opens the substack where the datagrid will be created, and then makes the substack invisible. When you later want to see the substack, just make it visible. Now the datagrid labels appear correctly in the window of the subscript.
on openStack
go to "dataStack"
go to "mainStack"
set the visible of stack "dataStack" to false
end openStack
Re: datagrid on substack - no labels
Posted: Sat Dec 11, 2010 8:05 pm
by kwinkler
or more elegantly still,
on openStack
go invisible to "dataStack" -- this window must be open (though invisible) for the dataGrid to appear correctly
end openStack
Re: datagrid on substack - no labels
Posted: Sun Dec 12, 2010 5:07 am
by deebee
Couldn't you just:
Code: Select all
on openStack
start using stack "dataStack"
end openStack
Then you don't have to set it invisible?
Re: datagrid on substack - no labels
Posted: Sun Dec 12, 2010 3:52 pm
by kwinkler
That would make the datagrid work correctly, but the dataStack is an optional window that many users will not want to see. So there is a menu item that lets the user open the dataStack window when needed.
I guess my post would have been more clear if I had mentioned that.