Stop preOpenCard handler from triggering with App Browser

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Stop preOpenCard handler from triggering with App Browser

Post by dave_probertGA6e24 » Fri Sep 21, 2012 9:19 pm

Sorry this is going to be a bit of a Rant - 'ocs it's 3am and I'm getting annoyed with Livecode - lovely language but with an annoying (and sometimes crap) IDE.

Is there any way of turning off the bloody activation of handlers like preOpenCard/preOpenStack/openCard/etc when the user is in EDIT mode and switches to the card via the Application Browser? Because of this painfully Stupid 'Feature', I have lost another hour's worth of work thanks to Livecode hanging up because it is trying to run a handler when it really shouldn't be doing so. I know I could click the Messages button on the toolbar - but my question is "Why are the handlers being called during Edit mode" anyway?

Am I the only one who thinks it's kinda wrong for code to be running when the user is Editing? Especially if the code can cause a crash/hang of LC. Yes, I have tried Cmd-. etc - to no avail. I have a spinning beach ball when the pointer is over any LC window - no way to interrupt it as far as I can see.

I have written to support regarding this but got a message saying that it has always been this way and would break things if it was changed! Sorry, dumb answer - really? Ever heard of Evolution - things change to get better? If a simple feature like this would break everyone's use of LC then make it a Preference that the user can set - really quite easy. A very simple solution that does not break anything. Again - am I the only one who can see this? I can go in and modify the code (if I knew where to look and had the time) but then I'd have to do that each time LC got updated (which I know isn't really that often so it wouldn't be a hardship really!!). But why not have it done by the people who make it - then everyone gets the benefit?

On the note of preferences -
can the auto indenting be turned off?
can the cursor be sent to the start of the next line when it hits a outdented line (ie when leaving an end if part)?
can the shortcut keypresses be changed by the user?
can shortcuts be assigned to things like the "Application Browser"
can the editor be fixed so that it doesn't go to the top of the editable window when the user moves the cursor after cutting a line - it only needs to be left at the start of the cut - like any other editor in the world does!!!
can the error checking be improved in the system so that runaway loops, incorrect object references, etc don't cause the bloody IDE to crash so much?
can the Cmd-. bit be fixed so that it actually works.
can an auto save feature be made standard?
can a backup save before run be implemented (not a save over the original file, but a separate temp one so that a recovery could be made) ?

These are some of the things that might make the IDE a little more robust and professional. To be honest I'm really not interested in Embedded LC when LC is not really up to scratch with it's own editor. I certainly can't recommend LC over other stuff except for the cross platform ability - but that wears thin after a while.

Concentrate on making the IDE a better tool, add some actual documentation (the Oxford English Dictionary is a Reference - not a Manual!) - make some docs that can work alongside the tutorials. Freshen up the tutorials - fix mistakes and out-of-date stuff.

I could probably write a lot more ideas that would help LC be improved, but I'm too tired at the moment.

Suffice to say I'm getting to be less happy about LC - mainly due to the IDE. Please, RunRev, spend some time on it to make it better.

Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Stop preOpenCard handler from triggering with App Browse

Post by mwieder » Fri Sep 21, 2012 9:27 pm

Dave-

Well, no problem with ranting here, but...

In the IDE's menubar is "Suppress Messages". Enable that and your commands won't get triggered.

Oh... and if you don't want to be bothered with having to turn that on and off, you can check the environment in your code

Code: Select all

on preOpenCard
  if the environment is not "development" then
    do your stuff here
  end if
end preOpenCard
or you can check the current tool

Code: Select all

if the tool is not "pointer tool" then
...
end if

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Stop preOpenCard handler from triggering with App Browse

Post by mwieder » Fri Sep 21, 2012 9:36 pm

:oops: OK - I reread your note and saw the bit about the Messages menu, so you already know about that.
because it is trying to run a handler when it really shouldn't be doing so.
but there are times when I really do want to run preOpenCard and other handlers in Edit mode: for example plugin stacks, of which I make quite a few - they need to function normally no matter what mode the user is in, and usually that's in Edit mode. If certain handlers didn't work in one IDE mode or another this just wouldn't work out.

Dang computers do exactly what you tell them to do.

Post Reply