mouseEnter handler triggering error

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
bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

mouseEnter handler triggering error

Post by bd525 » Tue Mar 09, 2021 4:22 pm

I have no doubt the answer to this is simple--and findable somewhere in the forum--but I've wasted a bunch of time looking, without success. I have an "on mouseEnter" handler in the stack script that references tool tips text to put in a field. Buttons are in a group, so if I want to edit the script of one I first select Edit Group, then go to edit the button, but that triggers the mouseEnter handler--even though I am in edit, not running mode--but with a "no such object" error, because the field referenced in the handler isn't part of the group I'm editing (buttons). So I could comment out the mouseEnter handler whenever I need to edit the script of a button, then reverse that when finished, but that seems like an unnecessary hassle. A command at the beginning of the mouseEnter handler such as:

if runningMode = "edit" then exit mouseEnter

...would do the trick, it seems, but I don't know what form that command would take.

Or maybe there is better solution.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: mouseEnter handler triggering error

Post by bogs » Tue Mar 09, 2021 4:29 pm

bd525 wrote:
Tue Mar 09, 2021 4:22 pm
if runningMode = "edit" then exit mouseEnter
I believe what your looking for is -

Code: Select all

if the environment is "development" then <block your tooltips>
*Edit - I realized that may have been too vague. You can put it in an appropriate message handler if you need it to fire sometimes, but not all the time, and it can be optional based on some other factor as well (like the option or control key is down, a button you click on, based on some value, etc).
Image

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Re: mouseEnter handler triggering error

Post by bd525 » Tue Mar 09, 2021 4:36 pm

Well, I was right about the solution being simple. Thanks so much, bogs!

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: mouseEnter handler triggering error

Post by bogs » Tue Mar 09, 2021 4:50 pm

No problems, glad if it helped.

I believe you can also determine if your in editMode, and can *probably* (I've never tested it) stop tool tips from showing that way as well, but I'll leave that for you to experiment with :D
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: mouseEnter handler triggering error

Post by jacque » Wed Mar 10, 2021 6:21 pm

Probably the easiest way is to click the Messages button in the toolbar at the top of the screen. That turns off all messages until you toggle it back on again. No scripting needed.

Also, you don't always need to edit the group. Click on the Select Grouped button in the toolbar which will allow you to edit controls inside the group without going into full group editing mode.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply