DataGrid Crash to Desktop Revisited

Tom Glod tom at makeshyft.com
Thu Dec 19 15:17:05 EST 2019


Hey Bob....

When you set the data of a grid, the selection IS changed to empty. thats
all you need to know..... triggering another handler in this is the correct
way to do it.



On Thu, Dec 19, 2019 at 10:48 AM Bob Sneidar via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Yeah tried that. Data doesn't get set.
>
> My problem is that I have been using SelectionChanged to do a lot of
> things, like populate the card objects (I call it a form). I was thinking
> that there might be some way to discern that an existing SelectionChaged
> handler was in effect in the datagrid library, but then what? If I could
> pull that off, it would have to be in the dgdata custom property before it
> calls anything that might call selectionChanged. I suspect it would unravel
> something else though.
>
> What I will do instead is put all the code I need in another handler, and
> then call that handler in time. That is what I have done with all my other
> forms, but I thought I would revisit this in the hopes of a more
> comprehensive solution.
>
> Bob S
>
>
> > On Dec 18, 2019, at 17:28 , Mark Wieder via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> >> I'm not sure why this is, but I think it's because the datagrid library
> does something internernally that triggers another selectionChanged,
> causing an infiinite loop, forcing the engine to bail out.
> >
> > Yes, that's what I would expect. Selecting different data *should* cause
> another selectionChanged event.
> >
> >> Any ideas?
> >
> > on selectionChanged
> >      put the dgHilitedIndex of me into tHilitedIndex
> >      put the dgDataOfIndex [tHilitedIndex] of me into aDGData [1]
> >      lock messages
> >      set the dgData of me to aDGData
> >      unlock messages
> > end selectionChanged
> >
> > --
> > Mark Wieder
> > ahsoftware at gmail.com
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


-- 
Tom Glod
Founder & Developer
MakeShyft R.D.A (www.makeshyft.com)
Office:226-706-9339
Mobile:226-706-9793



More information about the use-livecode mailing list