by default hilite the 1st line of a list field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
SuperKRL
Posts: 1
Joined: Sun Apr 11, 2021 10:28 pm

by default hilite the 1st line of a list field

Post by SuperKRL » Sun Apr 11, 2021 10:34 pm

Hello.
I've already read the scriptingconferences and made researches on the different topics, but I haven't found (or understand ?) my answer...

I have a list field "myList" with 5 lines.
When I open the card, I would like to display this list with the 1st line highlighted by default and considered like selected.

Hope to be clear, I don't speak English currently...
Thx in advance for your help !

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: by default hilite the 1st line of a list field

Post by Klaus » Sun Apr 11, 2021 10:46 pm

Hi SuperKRL,

welcome to the forum!

You can do something like this in the script of your card:

Code: Select all

on opencard
  set the hilitedlines of fld "your field name here..." to 1
end opencard
...and considered like selected.
Not sure what you mean?
If you mean your list field has a "mouseup" script and consider it "clicked" :-)
then you can add a line:

Code: Select all

on opencard
  set the hilitedlines of fld "your field name here..." to 1
  send "mouseup" to fld "your field name here..."
end opencard
if you mean something different, please explain.


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: by default hilite the 1st line of a list field

Post by dunbarx » Tue Apr 13, 2021 9:33 pm

Klaus.

The OP means to consider the process "as if the line was selected", that is, as if it was clicked. You solution is just fine.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”