[Solved] Colorizing line only works once?

JJS jjs at krutt.org
Mon Feb 25 13:03:20 EST 2019


Thanks GUys.


Yes it was probably something with sorting.

Strange also was that after a few times another row got red then the one 
which was hilited. So i don't know why.

Yes i use the "of me" whenever the script is in the dg itself. But 
sometimes i need to command it from outside the dg.

I removed what i was working on as it costed me too much time, and did 
the other option, as i mentioned in another post.

So now the background of a ceel of a column is turning red, which is 
even nicer as it draws more attention.


So thanks for your suggestions!

Regards,

Jerry


Op 25-2-2019 om 17:25 schreef Bob Sneidar via use-livecode:
>> On Feb 25, 2019, at 08:03 , Tom Glod via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>>    - dgline and dgindex are different, and as bob said, when the sort is
>>    on, you have to work with dglines.
> Yes, lines will reorder according to their visible order, indexes will maintain their values persistent through a sort.
>
> This is a mixed blessing. Let's say you get the dgHilitedLine of a datagrid, then wait for the user to do something with the data. In the interim the user resorts the datagrid! Now when you go to SET the dgHilitedLine, it's no longer the same data!
>
> I always use dgHilitedIndex for this reason. The only reason you need dgHilitedLine is when you MUST process the data in the visible order. For instance if I delete a row, and I want to automatically hilite the prior row, I need to use the dgHilitedLine -1.
>
>>    - remember to use the "of me" syntax with every change you make to the
>>    controls of each row
> As mentioned in another recent post, "of me" is necessary because each line of a datagrid has a set of controls for each row named the same as every other row. While this is allowed in Livecode (I never understood why) it means that referencing a specific copy of a control requires you also reference the row group it belongs to. I suspect these messages get sent to the row group specifically so that LC can reference the specific control for a given row.
>
> Bob S
>
>
> _______________________________________________
> 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




More information about the Use-livecode mailing list