Senior moment memory block

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
MikeinHawaii
Posts: 90
Joined: Mon Jan 18, 2010 10:53 am

Senior moment memory block

Post by MikeinHawaii » Mon Feb 24, 2014 8:53 am

Hi all, my question: What is the handler name for picking a line in a scrolling list field"
I thought it was menuPick, but I have been having zero luck picking a line out of a three line scrolling field using it.
My script for the field is as follows:

On menuPick theItem
If it is "Choice 1" then go to card 1
else if it is "Choice 2" then go to card 2
else quit
end menuPick

Won't do anything. Please help.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Senior moment memory block

Post by Dixie » Mon Feb 24, 2014 9:29 am

Code: Select all

on mouseDown
   put word 2 of the clickline into theChoice
   put line theChoice of me
end mouseDown
or

Code: Select all

on mouseDown
   put line (word 2 of the clickline) of me
end mouseDown

MikeinHawaii
Posts: 90
Joined: Mon Jan 18, 2010 10:53 am

Re: Senior moment memory block

Post by MikeinHawaii » Mon Feb 24, 2014 10:32 am

Thanks Dixie. Yea I found clickLine just before returning here but after you posted your reply.

Here is how I got it to go:

on mouseUp
put the value of the clickLine into textOfClickedLine
put textOfClickedLine into fld "Whatever's"
end mouseUp


But thanks anyhow for helping.

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

Re: Senior moment memory block

Post by dunbarx » Mon Feb 24, 2014 4:24 pm

Mike.

Just so.

"MenuPick" is a message sent with such controls as comboBoxes and pullDowns. It is a menu-based message. A list field is just a field. It responds to mouse events, as you have discovered.

Craig Newman

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

Re: Senior moment memory block

Post by Klaus » Mon Feb 24, 2014 4:33 pm

Hi Mike,

or this way (in the list field script):

Code: Select all

on mouseup
  put the selectedtext of me into fld "Display the user selection"
end mouseup

Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”