Page 1 of 1

MenuBar Click w/o Menu Item

Posted: Tue Mar 08, 2011 8:41 pm
by townsend
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.

Re: MenuBar Click w/o Menu Item

Posted: Tue Mar 08, 2011 8:47 pm
by FourthWorld
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?

Re: MenuBar Click w/o Menu Item

Posted: Tue Mar 08, 2011 9:43 pm
by townsend
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.

Re: MenuBar Click w/o Menu Item

Posted: Tue Mar 08, 2011 11:07 pm
by FourthWorld
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?

Re: MenuBar Click w/o Menu Item

Posted: Tue Mar 08, 2011 11:39 pm
by townsend
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--

Re: MenuBar Click w/o Menu Item

Posted: Wed Mar 09, 2011 12:09 am
by dunbarx
Richard,

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

Craig