Mark,

I've experimented some today and had 'limited' success. Here's the best I came up with:

on revCloseStack curStack
   try
set the CurrentRect of stack "ScriptEditorRect" to the rect of stack "revNewScriptEditor 1"
   end try
end revCloseStack

on revEditScript
   send "setScriptEditorRect" to me in 10
end revEditScript

on setScriptEditorRect
set the rect of stack "revNewScriptEditor 1" to the CurrentRect of stack "ScriptEditorRect"
end setScriptEditorRect

I had to put the revCloseStack handler in a try/catch since there are no parameters sent to the message and "this stack" doesn't reflect whether you're closing the script editor or not. But it does record the location and size of where you last had it before closing.

The send command, which I forgot on Friday, didn't work unless I sent it in 10 milliseconds. That's the lowest I could get it down to, and it only produced a small amount of 'window jumping' which is acceptable.

The real problem I ran into was the difference between relocating the script editor window and resizing it. Relocating it worked but resizing it somehow made Livecode intercept my messages and return it to a default location. And for some weird reason that default location is now on my second monitor.

The only way around this 'intercept' was to lock messages just before setting the rect of the script editor and then unlock them right afterward. This opened the overall the script editor window to the rect I specified, but it left all the controls inside of it as if the window had opened in its previous rect which was unacceptable.

So it's still a mess but the upside is I got some good experience working with front scripts and plugins which you introduced me to. Thanks!

All of this seems like a lot of work to go through just to get Livecode's script editor, the one area where more work is done than anywhere else, to behave as it should out of the box. It may seem like a minor thing but if you open and close this window 10 to 15 times a minute all day long it, the constant fighting with Livecode for where it opens can mean the difference between a productive, fluid and pleasant work day and a day which is instead difficult, frustrating stop-and-go of constant annoyances diverting your attention away from the job at hand.

I don't think there's any way around this so I'll just leave the bug report stand and hope somebody in Edinburgh gets to it.

Thanks,

Ray

On 1/31/2014 6:19 PM, Mark Schonewille wrote:
Hi Ray,

You're doing it wrong. Have a look at the send command in my script. It is quite obvious.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com

Buy my new book "Programming LiveCode for the Real Beginner" http://qery.us/3fi

LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 2/1/2014 00:16, Ray wrote:
So here's what I'm trying:
    Make a stack called "Test Front Script" with the following script in
its one and only card:
          on revEditScript
           answer the openStacks
          end revEditScript
    Put the "Test Front Script" stack in the Plugins folder
    Launch LC and make a New Mainstack
    Choose Development/Plugins/Plugin Settings
    Choose the Test Front Script, select RevEditScript in the list and
close Plugin Settings
    Click on Development again, drag to Plugins and choose Test Front
Script which opens it

The revEditScript message is now trapped when I open the stack script,
but just as before, the only stacks listed as the openStacks are:
    Test
    revTools
    Untitled 1
    revMenuBar

Evidently the "revNewScriptEditor 1" is still not yet in existence and
thus can not be located anywhere.  That is, if I leave the script editor
window open and open another script I get "revNewScriptEditor 1" listed
in the openStacks, but by now it's too late.  The window already opened
partially off the screen.

Am I doing this right?

Thanks,

Ray



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to