datagrid won't work as livecode-file?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

datagrid won't work as livecode-file?

Post by tusa » Sun Apr 02, 2017 12:55 am

I've made an application with a datagrid in.
When I save as an standalone application every thing works fine.
When I just save it as a livecode-file the datagrid wo'nt get any data in?
What do I miss?

tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: datagrid won't work as livecode-file?

Post by tusa » Sun Apr 02, 2017 2:17 am

I've found this:
http://lessons.livecode.com/m/datagrid/ ... -data-grid

Now I can use the datagrid, and now I can delete a line ind the datagrid but not delete all data?
I even can't save stack...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: datagrid won't work as livecode-file?

Post by dunbarx » Sun Apr 02, 2017 4:44 am

Hi.

You are saying that the standalone works but the IDE stack does not? That is a new one for me. Are you sure? The standalone cannot do more or less than the stack itself.

To delete all data, either set the dgData or the dgText of the DG group to empty.

Craig Newman

tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: datagrid won't work as livecode-file?

Post by tusa » Sun Apr 02, 2017 7:42 am

Delete line is no problem:

Code: Select all

on mouseUp
   put the dgHilitedIndex of group "seqGrid" into theIndex
   send "DeleteIndex theIndex" to the dgControl of group "seqGrid"
end mouseUp
But delete the whole stuff is not working when I use a launcher:

Code: Select all

on mouseUp
   answer question "Er du sikker på at du vil slette din Sekvensliste?" with "Nej" or "Ja"
   if it is "Ja" then
      set the dgData of group "seqGrid" to empty
   else
      end if
end mouseUp

tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: datagrid won't work as livecode-file?

Post by tusa » Sun Apr 02, 2017 8:03 am

Could it be related to my answer dialog box?
If I just use this piece of code:

Code: Select all

on mouseUp
   set the dgData of group "seqGrid" to empty
   end mouseUp
there is no problem.

Maybe that's why I don't get the dialog box when I save the stack also?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: datagrid won't work as livecode-file?

Post by jacque » Sun Apr 02, 2017 8:07 pm

It sounds like the standalone does not include the answer dialog, so the handler aborts at that line. Check the extensions pane in the standalone settings and make sure answer dialogs are included.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: datagrid won't work as livecode-file?

Post by dunbarx » Sun Apr 02, 2017 9:02 pm

@Jacque.

Just for discussion. Either the engine will search for instances of the answer dialog and include automatically, or, if you manage inclusions manually, the answer dialog is included by default. Anyway, if the inclusion is not there, is it so that the dialog would open but then simply not be handled when dismissed? I never tried that, but I would have assumed that the dialog itself would simply not open.

Anyway, this means that the OP deselected it by hand?

@Tusa. Might you have done that by accident?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: datagrid won't work as livecode-file?

Post by jacque » Sun Apr 02, 2017 10:18 pm

@Craig, you're right on all counts. But a missing inclusion is the only thing I could think of that would cause both failures. If it's missing, it must have been deselected somehow because the ask/answer dialogs are included by default.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: datagrid won't work as livecode-file?

Post by tusa » Mon Apr 03, 2017 6:28 am

It's not the standalone application.
I'm running it with a splash launcher, because I need opptunity too save the date before I close the app.
So it is the livecode stack file.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: datagrid won't work as livecode-file?

Post by jacque » Mon Apr 03, 2017 6:55 am

tusa wrote:It's not the standalone application.
I'm running it with a splash launcher, because I need opptunity too save the date before I close the app.
So it is the livecode stack file.
It's the same thing. All extensions are stored in the standalone, so if the answer dialog isn't included in the standalone stack, it won't show up in any other stack it opens either. Extensions can't be attached to plain stack files.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

tusa
Posts: 36
Joined: Sun Jan 31, 2016 10:30 pm

Re: datagrid won't work as livecode-file?

Post by tusa » Mon Apr 03, 2017 4:42 pm

Then how do I include the answer extension in the standalone?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: datagrid won't work as livecode-file?

Post by dunbarx » Mon Apr 03, 2017 5:53 pm

In the standalone settings, in the "General" pane, you will see the inclusions section, either automatic, where LC searches for required elements on its own, or manually, under "advanced Options". And in that advanced section, such ubiquitous elements as those dialogs are included by default. But if you just let LC do it, inclusions will be there if anything in your stack calls for them to be.

As Jacque mentioned, you would have had to choose "advanced", and then deselect that dialog explicitly in order for it not to be supported. The question is, did you? And to be clear, it is the "splash" stack that needs them.

These choices are there, I assume, if one wanted to create as lean a standalone as possible, eliminating all unnecessary supporting elements

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: datagrid won't work as livecode-file?

Post by dunbarx » Mon Apr 03, 2017 6:03 pm

Something else occurs to me.

In order for you to save a DataGrid, you had to include a "dud" stack in the "Stacks in the selected stack file" field of the "Stacks" pane. This is far more advanced stuff than just leaving the inclusions area of the "General" pane alone.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: datagrid won't work as livecode-file?

Post by jacque » Mon Apr 03, 2017 6:12 pm

The extensions have their own pane now, they are no longer in the general pane. Otherwise Craig is correct.

There was also a bug that did not correctly include datagrids, they had to be selected manually. I can't remember if that was fixed already or will be in the next release.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: datagrid won't work as livecode-file?

Post by dunbarx » Mon Apr 03, 2017 8:40 pm

Ah.
The extensions have their own pane now
The operative word being "now". It is my stubbornness, you see.

Craig

Post Reply