Re: set stack rect in startup handler
On 26/03/14 16:55, Robert Brenstein wrote: > On 24.03.2014 at 18:13 Uhr + Martin Baxter apparently wrote: >> Turns out that, when startup is run in the IDE, setting the stack rect >> works as I would expect, the size and position are modified correctly. >> But in a standalone, the stack size is set but not its position. So the >> startup handler obviously runs, but setting the stack rect doesn't have >> the side-effect of setting the loc. >> >> The same line in a preopenstack handler does work correctly however, so >> it is specifically in a standalone's startup handler that this issue >> appears to manifest. >> >> Anyway I have now bug-reported it. >> >> Martin > > Curious that this worked in an earlier version. Isn't startup run before > anything else? If so, it is quite likely that stack windows are not > there yet when it runs. > > RObert > Hi Robert Startup runs before any other scripts but the standalone must at least be completely loaded into memory beforehand, in order for the startup script to be accessible and executable. I would expect that setting the stack rect can precede the creation of the stack window, in the startup handler it's probably just stored as a property, and not actually used until some time later when the window is actually drawn. I've been doing that in standalone startup handlers since way back, so it is definitely 6.6 that is different. The bug report is now marked as confirmed BTW. Martin ___ 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
Re: set stack rect in startup handler
On 24.03.2014 at 18:13 Uhr + Martin Baxter apparently wrote: Turns out that, when startup is run in the IDE, setting the stack rect works as I would expect, the size and position are modified correctly. But in a standalone, the stack size is set but not its position. So the startup handler obviously runs, but setting the stack rect doesn't have the side-effect of setting the loc. The same line in a preopenstack handler does work correctly however, so it is specifically in a standalone's startup handler that this issue appears to manifest. Anyway I have now bug-reported it. Martin Curious that this worked in an earlier version. Isn't startup run before anything else? If so, it is quite likely that stack windows are not there yet when it runs. RObert ___ 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
Re: set stack rect in startup handler
Hi Phil, That's correct, although as Craig pointed out you can run the startup handler in the IDE from the message box, which I did on his suggestion as a test. Turns out that, when startup is run in the IDE, setting the stack rect works as I would expect, the size and position are modified correctly. But in a standalone, the stack size is set but not its position. So the startup handler obviously runs, but setting the stack rect doesn't have the side-effect of setting the loc. The same line in a preopenstack handler does work correctly however, so it is specifically in a standalone's startup handler that this issue appears to manifest. Anyway I have now bug-reported it. Martin On 24/03/14 17:51, Phil Davis wrote: > If I remember correctly, the startup message isn't available to our > stacks in the IDE. Otherwise (in standalones) it should be. > > Phil Davis > > > On 3/24/14, 7:21 AM, Martin Baxter wrote: >> This: >> >> on startup >>set the rect of this stack to "100,100,300,300" >> end startup >> >> Does not seem to work in version 6.6 (at least for me, on Linux) >> >> Obviously the idea is to set the initial position of an application >> window. >> >> What happens is that the window is correctly sized to 200 * 200 px, but >> the specified position on screen is not honoured. The stack window may >> open centered or displaced by whatever other windows are already open. >> Setting the loc doesn't seem to work either. >> >> This worked for me in 6.5.2 and earlier. >> >> I'm thinking this is a bug, does anyone else have any insight on this? >> >> Martin ___ 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
Re: set stack rect in startup handler
If I remember correctly, the startup message isn't available to our stacks in the IDE. Otherwise (in standalones) it should be. Phil Davis On 3/24/14, 7:21 AM, Martin Baxter wrote: This: on startup set the rect of this stack to "100,100,300,300" end startup Does not seem to work in version 6.6 (at least for me, on Linux) Obviously the idea is to set the initial position of an application window. What happens is that the window is correctly sized to 200 * 200 px, but the specified position on screen is not honoured. The stack window may open centered or displaced by whatever other windows are already open. Setting the loc doesn't seem to work either. This worked for me in 6.5.2 and earlier. I'm thinking this is a bug, does anyone else have any insight on this? Martin ___ 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 -- Phil Davis ___ 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
Re: set stack rect in startup handler
Hi Craig, In the IDE it works correctly when startup is invoked from msg, but once the stack is built into a standalone it doesn't. The standalone in question is just to test this issue, and has only a quit button. I build it with a size different from 200 by 200, so I can tell that the on startup handler runs, because the stack is resized to 200 by 200, but is not placed at screen loc 300,300 as expected. However the line does work as desired if placed into the preopenstack handler instead of on startup. I'm not keen to move my configuration code to the app's preopenstack if I can avoid it though - in the actual application that I'm working on that could be a bit untidy, the real-world case is more involved than the test stack of course. Martin On 24/03/14 15:15, dunb...@aol.com wrote: > Martin. > > > What happens if you run this line from msg after the window is open? > > > > Craig > > > > -Original Message- > From: Martin Baxter > To: How to use LiveCode > Sent: Mon, Mar 24, 2014 10:22 am > Subject: set stack rect in startup handler > > > This: > > on startup > set the rect of this stack to "100,100,300,300" > end startup > > Does not seem to work in version 6.6 (at least for me, on Linux) > > Obviously the idea is to set the initial position of an application window. > > What happens is that the window is correctly sized to 200 * 200 px, but > the specified position on screen is not honoured. The stack window may > open centered or displaced by whatever other windows are already open. > Setting the loc doesn't seem to work either. > > This worked for me in 6.5.2 and earlier. > > I'm thinking this is a bug, does anyone else have any insight on this? > > Martin > ___ 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
Re: set stack rect in startup handler
Martin. What happens if you run this line from msg after the window is open? Craig -Original Message- From: Martin Baxter To: How to use LiveCode Sent: Mon, Mar 24, 2014 10:22 am Subject: set stack rect in startup handler This: on startup set the rect of this stack to "100,100,300,300" end startup Does not seem to work in version 6.6 (at least for me, on Linux) Obviously the idea is to set the initial position of an application window. What happens is that the window is correctly sized to 200 * 200 px, but the specified position on screen is not honoured. The stack window may open centered or displaced by whatever other windows are already open. Setting the loc doesn't seem to work either. This worked for me in 6.5.2 and earlier. I'm thinking this is a bug, does anyone else have any insight on this? Martin ___ 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
set stack rect in startup handler
This: on startup set the rect of this stack to "100,100,300,300" end startup Does not seem to work in version 6.6 (at least for me, on Linux) Obviously the idea is to set the initial position of an application window. What happens is that the window is correctly sized to 200 * 200 px, but the specified position on screen is not honoured. The stack window may open centered or displaced by whatever other windows are already open. Setting the loc doesn't seem to work either. This worked for me in 6.5.2 and earlier. I'm thinking this is a bug, does anyone else have any insight on this? Martin ___ 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
Re: startup handler
On 11/29/11 10:36 AM, Bob Sneidar wrote: I get the password clear, then unencrypt the stored password and check it against the entered one. After I am done I delete the variables. SSL isn't supported on mobile yet, so this solution won't work there. That's one reason I ranked SSL as a high priority in the recent RR survey. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ 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
Re: startup handler
Hi Mark. I get the password clear, then unencrypt the stored password and check it against the entered one. After I am done I delete the variables. It's probably not the best way security wise, but it allows me to pick my own encryption method. Someone would have to find a way to stop the app mid execution and do a memory dump to get the password in it's unencrypted state. I use aes128 with a seed value unique to each password record. That seems pretty secure to me. Not sure if the full encryption library is available to the iOS app tho'. Bob On Nov 28, 2011, at 10:05 PM, Mark Smith wrote: > > J. Landman Gay wrote >> >> On 11/28/11 10:15 PM, Mark Smith wrote: >> >>> Now, before I begin, both the stack in the IDE and tested on the iPhone >>> simulator report the encrypted pw as \VUw|1,A so, no difference there. >> >> I get a difference. >> > > Thank you (once again). Your testing was more thorough. When I said I did > not get a difference I meant when I read the value from the custom property > (cpassword) on iOS and desktop it was the same ie. was still encrypted. It > never occurred to me to test the *new* password that was being generated > (duh!!) until I saw your message and put 2 n' 2 together. I also get an > un-encrypted montreal on iOS. > > I'll report it as a problem. > > I know the big yellow banner at the top of my screen says don't waste space > saying thanks. So I won't :-) > > > -- > View this message in context: > http://runtime-revolution.278305.n4.nabble.com/startup-handler-tp4117800p4118166.html > Sent from the Revolution - User mailing list archive at Nabble.com. > > ___ > 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
Re: startup handler
J. Landman Gay wrote > > On 11/28/11 10:15 PM, Mark Smith wrote: > >> Now, before I begin, both the stack in the IDE and tested on the iPhone >> simulator report the encrypted pw as \VUw|1,A so, no difference there. > > I get a difference. > Thank you (once again). Your testing was more thorough. When I said I did not get a difference I meant when I read the value from the custom property (cpassword) on iOS and desktop it was the same ie. was still encrypted. It never occurred to me to test the *new* password that was being generated (duh!!) until I saw your message and put 2 n' 2 together. I also get an un-encrypted montreal on iOS. I'll report it as a problem. I know the big yellow banner at the top of my screen says don't waste space saying thanks. So I won't :-) -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/startup-handler-tp4117800p4118166.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ 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
Re: startup handler
On 11/28/11 10:15 PM, Mark Smith wrote: Now, before I begin, both the stack in the IDE and tested on the iPhone simulator report the encrypted pw as \VUw|1,A so, no difference there. I get a difference. The above code works fine on the IDE when the correct pw is entered (montreal), and loops endlessly on the iPhone saying "Incorrect password. Please try again" when the same password is entered. Any wisdom or guidance for the lost I had the same problem in one of my stacks, but in the iOS simulator the password is not reported as an encrypted string, it returns "montreal" as plain text. In other words, on iOS the engine isn't encrypting it. I haven't found a solution. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ 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
Re: startup handler
J. Landman Gay wrote > > Startup is sent only once when the engine is first launched. In the IDE, > that happens long before any user stacks open (I think the IDE Home > stack catches it.) Startup will never occur in a stack open in the IDE, > only in a standalone. > Thanks Jacque, I more or less suspected this but since it was not in the dictionary thought I would seek confirmation. Here's another little conundrum I've run into that you might be able to help with (or someone). I've stored an encrypted password away in a custom property called cpassword and use the following code to compare the user entered value: on askpassword ask password "Enter password:" if it is empty then quit if it = the cpassword of this stack then exit askpassword else # incorrect password answer "Incorrect password. Please try again." askpassword end if end askpassword Now, before I begin, both the stack in the IDE and tested on the iPhone simulator report the encrypted pw as \VUw|1,A so, no difference there. The above code works fine on the IDE when the correct pw is entered (montreal), and loops endlessly on the iPhone saying "Incorrect password. Please try again" when the same password is entered. Any wisdom or guidance for the lost Thanks -- M PS have not tried it on a real iPhone yet, but probably will try that just to rule out the improbable likelihood that this is a sim related problem. -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/startup-handler-tp4117800p4118026.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ 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
Re: startup handler
On 11/28/11 8:31 PM, Mark Smith wrote: Hi, just wondering if there is something special about the startup handler. The following code (executed in the IDE) does nothing: on startup if the cpassword of this stack is empty then Startup is sent only once when the engine is first launched. In the IDE, that happens long before any user stacks open (I think the IDE Home stack catches it.) Startup will never occur in a stack open in the IDE, only in a standalone. I could have sworn that was in the dictionary, but it isn't under the "startup" message so it's probably buried somewhere else. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ 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
startup handler
Hi, just wondering if there is something special about the startup handler. The following code (executed in the IDE) does nothing: on startup if the cpassword of this stack is empty then ask password "Please enter a new password:" put it into temp1 ask password "Please re-enter password:" put it into temp2 if temp1 <> temp2 then answer "Passwords do not match. Please try again" startup end if set the cpassword of this stack to temp2 end if if the environment is "mobile" then iphoneSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right" askpassword end if end startup Even though the following, downloaded and tested on an iPhone works fine: on startup if the environment is "mobile" then iphoneSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right" end if end startup Can "startup" not handle user I/O or..??? Thanks -- Mark PS the code logic is fine, and worked once I moved the "interactive" portions into the preOpenStack handler. But the documentation does not appear to make mention of this limitation. I think. -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/startup-handler-tp4117800p4117800.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ 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