π
<-
Chat plein-écran
[^]

ETK LUA Help

Pour TI-Nspire OS 3.0 ou ultérieur.

ETK LUA Help

Unread postby j_love » 19 Jun 2019, 11:14

Hello everyone,

I am new to this forum. Thanks for creating this nice forum and all the stuff here.

I do have a problem creating lua scripts with the ETK Framework.

I am using the Student Software to simulate the scripts.
Can someone just tell me on howto implement the ETK Framework.
Basically I just want to test the following:

Code: Select all
do
    local Input  = etk.Widgets.Input
    local Label  = etk.Widgets.Label
    local Button = etk.Widgets.Button

    local myView = etk.View()


    local btn1,inp2
    local btn1 = Button{}
    local inp2 = Input{}
    btn1.position = Position { top='31px',left='235px'  }
    inp2.position = Position { top='31px',left='22px'  }

    myView:addChildren(btn1,inp2)

    etk.RootScreen:pushScreen(myView)
end


When copy pasting this I do get the following error:
2: attempt to index global 'etk' (a nil value)

I also tried copying the etk and extras folder to the Documents/CX folder in Windows. Tried also to transfer the ETK files to my handheld but this does not work.
So how can I just start coding with ETK framework?

Thank you everyone.

Best Wishes
j_love
User avatar
j_love
Niveau 0: MI (Membre Inactif)
Niveau 0: MI (Membre Inactif)
Level up: 0%
 
Posts: 2
Joined: 19 Jun 2019, 11:01
Gender: Not specified

Re: ETK LUA Help

Unread postby Adriweb » 19 Jun 2019, 12:00

Hello,

I assume you're talking about the ETK version from here: https://github.com/TI-Planet/ETK

In which case, it has a build system and extended syntax that you "have to" use, in order for it to do all the heavy lifting of requiring/including the lib's files.

The end result would be the concatenation (among other things) of the files together. You can look at the demo.tns file that's the built version.

(Note: for the previous version of ETK, which some utilities use, look at formulapro for instance: https://github.com/adriweb/EEPro-for-Ns ... llcode.lua and its repo)

To "convert" from Lua to TNS, you can use Luna (recommanded) or the nspire computer software
User avatar
AdriwebAdmin.
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 51.6%
 
Posts: 12625
Images: 1081
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Class: (ingénieur)
Twitter: adriweb
GitHub: adriweb

Re: ETK LUA Help

Unread postby j_love » 19 Jun 2019, 13:53

Hi Adriweb,

thanks four your help.
I was not aware that I have to execute the build.lua script. After doing that it worked.
The build.lua script copies all the imports to a big.*.lua file which then can be copied into the script manager in the student software.

Thank you!
User avatar
j_love
Niveau 0: MI (Membre Inactif)
Niveau 0: MI (Membre Inactif)
Level up: 0%
 
Posts: 2
Joined: 19 Jun 2019, 11:01
Gender: Not specified


Return to Nspire-Lua

Who is online

Users browsing this forum: No registered users and 2 guests

-
Search
-
Featured topics
Concours TI-Planet-Casio de rentrée 2019. 3 défis pour plus d'une 15aine de calculatrices graphiques et nombre de goodies sortant de l'ordinaire ! :D
Comparaisons des meilleurs prix pour acheter sa calculatrice !
12
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...

Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety 
-
Stats.
1190 utilisateurs:
>1159 invités
>25 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)