Can't get Combo option button to action code.

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
CAsba
Posts: 389
Joined: Fri Sep 30, 2022 12:11 pm

Can't get Combo option button to action code.

Post by CAsba » Wed Feb 22, 2023 4:50 pm

Hi,
I've been trying to get the user's choice from a combo button into a field. Nothing I tried worked so I tried testing if a simple dialog would work, code...

Code: Select all

on menu pick
        answer "hhhh"  
end menu pick
but it didn't.
So obviously, more rarified code wouldn't work either.
Any ideas why the dialog doesn't appear on clicking on an option ?

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

Re: Can't get Combo option button to action code.

Post by Klaus » Wed Feb 22, 2023 4:52 pm

You want to use:

Code: Select all

on menupick the_picked_item
  answer the_picked_item
end menupick
Hint: The dictionary is way better than its reputation! 8)

CAsba
Posts: 389
Joined: Fri Sep 30, 2022 12:11 pm

Re: Can't get Combo option button to action code.

Post by CAsba » Wed Feb 22, 2023 6:48 pm

Many, many thanks, Klaus. I can now see my way through this phase of my project.

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

Re: Can't get Combo option button to action code.

Post by dunbarx » Wed Feb 22, 2023 8:35 pm

CAsba.

Be careful, "menuPick" is a message. it is not "menu pick"

Craig

CAsba
Posts: 389
Joined: Fri Sep 30, 2022 12:11 pm

Re: Can't get Combo option button to action code.

Post by CAsba » Thu Feb 23, 2023 10:31 am

Thanks, Dunbarx.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9458
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can't get Combo option button to action code.

Post by richmond62 » Thu Feb 23, 2023 12:40 pm

Screen Shot 2023-02-23 at 1.38.58 pm.png
-
Did I miss something?
Attachments
Combo-Ombo.livecode.zip
Stack.
(981 Bytes) Downloaded 54 times

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

Re: Can't get Combo option button to action code.

Post by Klaus » Thu Feb 23, 2023 1:09 pm

richmond62 wrote:
Thu Feb 23, 2023 12:40 pm
Did I miss something?
Yes, you did!
Take a look at the initial posting.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9458
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can't get Combo option button to action code.

Post by richmond62 » Thu Feb 23, 2023 1:24 pm

OK:
the user's choice from a combo button into a field

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

Re: Can't get Combo option button to action code.

Post by Klaus » Thu Feb 23, 2023 1:34 pm

richmond62 wrote:
Thu Feb 23, 2023 1:24 pm
OK:
the user's choice from a combo button into a field
Sigh, look at the script... :?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9458
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can't get Combo option button to action code.

Post by richmond62 » Thu Feb 23, 2023 4:47 pm

George Bush senior said, "Read my lips."

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

Re: Can't get Combo option button to action code.

Post by Klaus » Thu Feb 23, 2023 4:49 pm

I give up...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9458
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can't get Combo option button to action code.

Post by richmond62 » Thu Feb 23, 2023 9:27 pm

Well, Klaus, why would anyone write "I've been trying to get something into a field" if they've been
trying to get someone into a room?

I suppose that's just another example of muddy thinking.
-
SShot 2023-02-23 at 22.26.02.png
Attachments
Combo-Ombo.livecode.zip
Stack.
(816 Bytes) Downloaded 49 times

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

Re: Can't get Combo option button to action code.

Post by dunbarx » Fri Feb 24, 2023 12:39 am

Children...

I am not sure if CAsba really meant put the selected menuItem into a field or not. But the clear intent was to be able to extract the value of that selection and work with it.

CAsba. What are your intentions for the user's selection? The "hard" part was already solved by Klaus. I believe you are more than able to take it from there...

Craig

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

Re: Can't get Combo option button to action code.

Post by Klaus » Fri Feb 24, 2023 1:49 pm

Richmond,

the problem, which has been solved with my first reply, was not especailly to get something from a menu into a field or onto George Bush Jr/Sr lips or to get someone into a room (whatever you may mean with that? :shock: ), but that CAsba was just using a wrong syntax.

Nothing more and nothing less, is that so hard to understand?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9458
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can't get Combo option button to action code.

Post by richmond62 » Fri Feb 24, 2023 7:39 pm

No difficulty understanding that the OP was using the wrong syntax.

Difficulty understanding what s/he was aiming at as their words seemed to signal something different from their wonky code.

Hence Bush's lips, if you get the historico-cultural reference.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”