Page 1 of 1

datagrid won't work as livecode-file?

Posted: Sun Apr 02, 2017 12:55 am
by tusa
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?

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

Posted: Sun Apr 02, 2017 2:17 am
by tusa
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...

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

Posted: Sun Apr 02, 2017 4:44 am
by dunbarx
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

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

Posted: Sun Apr 02, 2017 7:42 am
by tusa
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

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

Posted: Sun Apr 02, 2017 8:03 am
by tusa
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?

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

Posted: Sun Apr 02, 2017 8:07 pm
by jacque
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.

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

Posted: Sun Apr 02, 2017 9:02 pm
by dunbarx
@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

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

Posted: Sun Apr 02, 2017 10:18 pm
by jacque
@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.

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

Posted: Mon Apr 03, 2017 6:28 am
by tusa
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.

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

Posted: Mon Apr 03, 2017 6:55 am
by jacque
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.

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

Posted: Mon Apr 03, 2017 4:42 pm
by tusa
Then how do I include the answer extension in the standalone?

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

Posted: Mon Apr 03, 2017 5:53 pm
by dunbarx
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

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

Posted: Mon Apr 03, 2017 6:03 pm
by dunbarx
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

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

Posted: Mon Apr 03, 2017 6:12 pm
by jacque
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.

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

Posted: Mon Apr 03, 2017 8:40 pm
by dunbarx
Ah.
The extensions have their own pane now
The operative word being "now". It is my stubbornness, you see.

Craig