Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Goran

Pages: 1 2 [3]
31
Lua / Problem with menu separation line
« on: September 30, 2012, 11:56:42 am »
Hello,

I am delighted with ability to specify my own menu for a script page using toolpalete:register() call.
I followed the example given in the Lua Scripting API Reference Guide.

Everything worked as described, except for separation lines (section dividers), specified by hyphen ("-"):
Instead of some kind of separation line, I get in the menu a disabled menu item (gray text) saying: "<number>: English (U.S.)".

Did anyone else experienced such a behavior?

Best regards,
Goran


32
Lua / Problem with on.loseFocus() function
« on: September 30, 2012, 11:34:19 am »
Hello,

I am a newbie regarding TI-Nspire Lua programming (got my CX CAS this week, immediately updated to OS v3.2).

Question:

Within a page running my Lua script, I want to store all entered values to TI.Nspire variables, before switching to another page within the same problem.
I tried to do it by using on.loseFocus() function, expecting this function will be the last one called  before leaving the script page.
On my surprise, printing out the variable values at the other page showed the old variable values, indicating the variables have not been stored.
In order the correct values are printed out, I have to re-visit the script page (there I do not edit anything, as I see there the correct values I entered the first time)
and switch back to printing page: then I see the current values.

Putting a breakpoint within on.loseFocus() function revealed that navigating away from the script page did not trigger the function.
The function has been triggered for the first time on re-visiting the script page, after on.getFocus() function made its job.

On the other hand, on.getFocus() function does its job as expected: whenever I enter the script page, I get the initial setup I defined by this function.

Do I do/understand something wrong?

Another short question just crossed my mind:
Is on.construction() function triggered each time I enter a script page, or only once, at entering the script page for the first time after I load a document?
 
Thanks for your help,
Goran

Pages: 1 2 [3]