datagrid on substack - no labels

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am
Location: Connecticut, USA

datagrid on substack - no labels

Post by kwinkler » Sat Dec 11, 2010 5:50 pm

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
Screen shot 2010-12-11 at 11.44.26 AM.png (226.67 KiB) Viewed 3958 times

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am
Location: Connecticut, USA

Re: datagrid on substack - no labels

Post by kwinkler » Sat Dec 11, 2010 6:51 pm

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.

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am
Location: Connecticut, USA

Re: datagrid on substack - no labels

Post by kwinkler » Sat Dec 11, 2010 7:13 pm

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
Screen shot 2010-12-11 at 1.11.07 PM.png (19.21 KiB) Viewed 3949 times
Update 2-

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am
Location: Connecticut, USA

Re: datagrid on substack - no labels

Post by kwinkler » Sat Dec 11, 2010 7:58 pm

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

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am
Location: Connecticut, USA

Re: datagrid on substack - no labels

Post by kwinkler » Sat Dec 11, 2010 8:05 pm

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

deebee
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 89
Joined: Mon Jul 19, 2010 6:59 am
Location: Illinois, USA

Re: datagrid on substack - no labels

Post by deebee » Sun Dec 12, 2010 5:07 am

Couldn't you just:

Code: Select all

on openStack
     start using stack "dataStack"
end openStack
Then you don't have to set it invisible?

kwinkler
Posts: 61
Joined: Fri Nov 26, 2010 5:59 am
Location: Connecticut, USA

Re: datagrid on substack - no labels

Post by kwinkler » Sun Dec 12, 2010 3:52 pm

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.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”