dataGrid's dgText hangs the execution in some cases

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

dataGrid's dgText hangs the execution in some cases

Post by giovannic » Sat Apr 18, 2009 1:33 pm

Hi all!
I've a little problem with the dgText datagrid's property that, in some circumstances hangs the execution of the script when set to empty.

To avoid to try to describe with words the problem I've prepared a little example stack that reproduce the issue.
Where and how can I attach this stack?
If I can't attach the stack here is how to create it:

- Create a new mainstack with a substack;
- Put a datagrid named "myDG" in the substack and a button in the mainstack;
- Put this lines in the script of the button:

Code: Select all

on mouseUp
   set the dgText of grp "myDG" of stack "Untitled 2" to empty
   set the dgText of grp "myDG" of stack "Untitled 2" to "Hello" & tab & "World" & tab & "!!!"
   set the dgText of grp "myDG" of stack "Untitled 2" to empty
   
   go to stack "untitled 2"
end mouseUp
U can see that the stack "Untitled 2" is never opened.
The execution hangs after the first:

Code: Select all

   set the dgText of grp "myDG" of stack "Untitled 2" to empty
My question is: it's a bug or it's an incorrect use of the dgText property?
Thank u for all and bye!

[PS: I've moved this post... I've posted it in the wrong place... excuse me]

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Mon Apr 20, 2009 5:31 pm

The data grid is choking because the stack the data grid is on is not open. The data grid currently relies on the formattedHeight to render some of it's data but formattedHeight returns 0 when the stack is closed. The current workaround is to set data in the preopenstack handler. I will look at delaying any rendering until the data grid is open in the next version.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

giovannic
Posts: 30
Joined: Fri Apr 17, 2009 7:05 pm

Re

Post by giovannic » Mon Apr 20, 2009 10:38 pm

Thank u Trevore, for ur reply(es!!!)
See u!

Post Reply