MenuBar Click w/o Menu Item

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
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

MenuBar Click w/o Menu Item

Post by townsend » Tue Mar 08, 2011 8:41 pm

I used the Auto Script button in the Menu Builder to build this script:

Code: Select all

--The following menuPick handler was generated by the Menu Builder.
on menuPick pWhich
    switch pWhich
    case "one"
       --Insert script for one menu item here
       break
    case "two"
       --Insert script for two menu item here
       break
    end switch
end menuPick
This works really well. But-- what about messages from Menus without Items?
(Once the single default item of New Menus are deleted.)

Clicking on the Edit Script button of such a Menu generates this:

Code: Select all

on menuPick pItemName
     beep
     switch pItemName
          
     end switch
end menuPick
But the Message (event) never happens, as per my above beep statement.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: MenuBar Click w/o Menu Item

Post by FourthWorld » Tue Mar 08, 2011 8:47 pm

townsend wrote:But-- what about messages from Menus without Items?
I think I'm missing something: how could a menuPick message be generated if there is no menu item to pick?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: MenuBar Click w/o Menu Item

Post by townsend » Tue Mar 08, 2011 9:43 pm

The hierarchy goes: Menu Bar, Menu, Menu Item.

When you create a Menu, you assign it a name. For intance, "Testing".
Now you can put many Menu Items under "Testing", and they work fine.
But if you delete all Menu Items under Testing", you are left with a
what appears to be click-able selection in the Menu Bar.

I've looked everywhere: in this forum, in Rev Online, Resource Center,
LiveCode Tutorials, and new Lessons Section. I guess it's not possible.

I can just use a row of Buttons, grouped together, to get the same effect.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: MenuBar Click w/o Menu Item

Post by FourthWorld » Tue Mar 08, 2011 11:07 pm

The menubar group will get a mouseDown message when its contents are clicked, but I'm curious: what is the function of a menu with no items?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: MenuBar Click w/o Menu Item

Post by townsend » Tue Mar 08, 2011 11:39 pm

I'm curious: what is the function of a menu with no items?
I was just going to use them to quickly jump to different Cards.
Menu Items are really, drop downs off the each "Menu" on the Menu Bar.
With four cards, I'd have four Menu selections. No matter.
A grouped set of four buttons does the same thing.

Thanks for your reply Richard--

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: MenuBar Click w/o Menu Item

Post by dunbarx » Wed Mar 09, 2011 12:09 am

Richard,

it was this post that made me test that errant menu you helped me with in the use list.

Craig

Post Reply