Author Topic: documentation on ETK API?  (Read 5322 times)

0 Members and 1 Guest are viewing this topic.

Offline Goran

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
documentation on ETK API?
« on: August 07, 2013, 09:58:22 am »
Hello,

Is there any API documentation for ETK?

I currently go through the code itself, I made a cetrain progress in using it, but anyway I have some doubts that can be removed in this way only after I go 100% through to grasp all the concepts.

Best regards,
Gooran

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: documentation on ETK API?
« Reply #1 on: August 07, 2013, 03:08:10 pm »
Hi,

We (Jim Bauwens and I) haven't released what we can call an official documentation (we'll probably do that for version 3, though !), however learning by examples isn't bad neither :
I advise you to download this demo document :
http://tiplanet.org/forum/archives_voir.php?id=9275
in which the princples of ETK are showed.

And, well, of course, FormulaPro which uses it extensively...
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Goran

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: documentation on ETK API?
« Reply #2 on: August 07, 2013, 04:03:29 pm »
Thanx adriweb,

FormulaPro is the exact script I am learning from. On the other hand, I see now in the mentioned demo additional nice widgets! (as I am currently at vacation without my development environment, peeking into demo will have to wait for few days).

Maybe for now only one question:

Is it meant that WScreen has at least one child widget? The reason for question is the following: originally I had a graphical editor that, after discovery of ETK, I have "embeded" into a WScreen.
On PC everything works as planned (Moving, flipping, rotating, editing, connecting of graphical elements).
When I downloaded the app to the handheld, everything worked ok except connecting two elements: I grab the first point, drag a line to the second point, but I cannot make connection on "release" action (mouseUp).

Then I looked to ETK code, and thought maybe the handling of mouseUp event would be correct if I had put the whole graphical editor into a child screen widget? Or I talk rubbish?

Regards,
Goran

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: documentation on ETK API?
« Reply #3 on: August 08, 2013, 07:21:35 am »
Hmm, on the demo code, the Main screen is defined as : Main = WScreen(), and usual init stuff.

You can see the code directly here :
http://pastebin.com/1Yv7EvC9

Starting code really starts at line ~ 1760.


The problem you describe with things working on the computer software but not on the handheld seems weird though :o
What OS versions are you using ?
Have you checked that all the needed platform.window:invalidate() are here, just in case ?
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Goran

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: documentation on ETK API?
« Reply #4 on: August 08, 2013, 09:49:33 am »
Thanks for the link, I will go into it soon.

I use 3.2.3.1233 on the handheld.

Regarding invalidite() calls, I'll check them thoroghfully again when I return home. Nevertheless, good you mentioned them, I've also noticed that in the software (after one operation) the screen is refreshed immediatelly, while on the handheld I have to move the mouse first. Why this difference? Is there a list of differnces that are considered as normal when running an app in software and on the handheld?

Secondly, whenever I want mouse cursor to appear at the handheld, I have to scroll across the touchpad for 1-2 seconds before the cursor appears, what is a bit annoying, especially if you compare it with the prompt response in the software; also in software the cursor is always on, while on handheld it dissapears after several seconds of inactivity; which means that when I operate upon the elements on the screen, I constantly have to scroll around the touchpad to get the cursor first. This is the general behavior, not just within my app. Is there a way to improve here anything?

Thirdly, what is/are keystrokes on the handheld that are equivalent to releasing mouse left button in software?
On my side I will have to check again my code where I was messing around with on.charIn, on.mouseDown, on.mouseUp and on.mouseMove functions.

Regards and thanks,
Goran


Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: documentation on ETK API?
« Reply #5 on: August 09, 2013, 12:37:34 pm »
Yes, be sure to invalidate your screen if you want your application to be updated. On the PC/Mac software this happens very much without needing to invalidate yourself, so your application might seem to work properly on the computer software but not on the handheld. Also moving your mouse on the handheld might trigger invalidation of the screen (causing it to update). So just invalidate your screen when you want it to update.

Sadly enough we can't change how the cursor reacts. It's indeed quite horrid how it works now.

Normally on.mouseUp should be called when releasing the left mouse button on the handheld.