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!
I have a group of buttons that behaves like a 'custom-dropdown' menu. When I click on the button, the dropdown menu appears. The problem is that I can't make group to hide when any other button (with script) in stack is clicked.
Are you clicking on the card when you want the group to hide? Or another button?
If a button, what script does it contain? By default, a new button will have an empty on mouseUp handler. That would trap the mouseUp message stopping it from reaching the card but do nothing, unless you delete the empty handler or pass mouseUp within it.
Have you tried putting pass mouseUp into your mouseUp handler in the button.
I am still learning much of livecode myself but I believe this will allow the message to pass along the message path.
Exactly, if you don't include a "pass mouseUp" statement in the mouseUp handler of the button then the mouseUp message will stop once caught by the button handler and never reach the card.
You could possibly make things easier to maintain if you can use behaviors or simply break out the button scripts to call a generic command but we'd need to see more code. At the least though, you could add "hideTheGroup" to the button scripts and in the card script have
SparkOut wrote: By default, a new button will have an empty on mouseUp handler. That would trap the mouseUp message stopping it from reaching the card but do nothing, unless you delete the empty handler or pass mouseUp within it.
Actually a new button has no script. LC inserts the empty mouseUp handler template as a convenience the first time you open the button script for editing. If you hit the Enter key, you end up saving the blocking empty handler.
This can be either convenient or confusing. If you ask for the script of a new button in the message box it comes back empty. Some other controls provide the same kind of default template handlers that don't really exist until compiled.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
That's interesting. I've never tried getting the script in that way before looking in the script editor. It does make perfect sense, of course, and I have used new buttons without having to delete an empty handler before, triggering mouseUp further up the message path, so I was not thinking clearly. It's just that first view in the editor that creates the empty handler, which if applied, will block the mouseUp from travelling up the message path.
Of course, in the OP's case, the buttons do contain script. Just not a "pass mouseUp" statement, or a call to a handler to close the group.