Author Topic: Updating WZGUILib  (Read 156362 times)

0 Members and 2 Guests are viewing this topic.

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #105 on: June 17, 2012, 10:56:53 am »
I just thought I would post what it looks like when you change the on.create to on.construction on the "UseThisFile.lua" file that I had provided above and run it in 3.2...

What this means is that if I want to still have 3.1 compatibility, I will have to have diffrent drawing code, at least for strings.
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Updating WZGUILib
« Reply #106 on: June 17, 2012, 06:27:55 pm »
That doesnt sound right. I don't see why drawing-related stuff would get changed... ?
Can you post the full code, I'll be helping you :P
(Edit:  or is it directly the UseThisFile.lua ? )
« Last Edit: June 17, 2012, 06:33:44 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #107 on: June 17, 2012, 07:20:30 pm »
It is Directly using the UseThisFile.lua file that that is located in page 7, I just changed on.create to on.construction
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Updating WZGUILib
« Reply #108 on: June 18, 2012, 02:18:47 am »
Is the problem related to the "middle" in [lua]gc:drawString[/lua] you used, or did you not use anything before ?

(I recommend you to use "top". I have no problems in 3.1/3.2 with it, as it's the most accurate argument)
« Last Edit: June 18, 2012, 02:22:36 am by jimbauwens »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Updating WZGUILib
« Reply #109 on: June 18, 2012, 07:20:40 am »
I just put that up on Inspired-Lua's [lua]gc:drawString[/lua] :

My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #110 on: June 18, 2012, 09:00:25 am »
the problem is related to middle, thanks for the help
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #111 on: June 21, 2012, 08:06:00 pm »
So I have an Idea that could change the way WZGUILIB operates and can be used forever, if it works. I will keep you posted.
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #112 on: June 27, 2012, 10:43:51 am »
So I solved the Idea for styles. I believe that I can store all of the paint, checkClick, click, and other methods that deal with how they are drawn and interacted with by the user. What this would allow is having multiple styles on one calculator without having to take up a large amount of space. It also would allow the programmer change between styles in the middle of the program by calling the function loadLibs(). The libs would be loaded at runtime after the creation of the objects and will load only one time unless the programmer calls loadLibs() later on.
I do have a questions though before I jump in and start changing code.
How much does var.recall fail when trying to get external data.

Also I did some testing with loading strings into lua strings and I ran into a problem. The Document that I created I put a string in it, but it wont load. I then used a file that came with Make3D_lib and it loaded the strings successfully. I used one lua file that I created to do this. Did levak do something diffrent than what I did to get his stuff to load properly?
I included the files.
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #113 on: June 27, 2012, 11:32:47 pm »
So I got the strings to load successfully, but I have another problem.
When you use assert() to run the lua chunck, how can you use the variables that already exist?
I get an error that global gc has been indexed so I know something isnt working.
I included the files that I have created in order to test this stuff out.
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Updating WZGUILib
« Reply #114 on: June 28, 2012, 05:11:36 pm »
Normally if you execute a new lua chunk it should be able to access all the existing variables.
I'll take a look at your code tomorrow.

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #115 on: June 28, 2012, 08:08:49 pm »
thanks, maybe its a student software bug?
« Last Edit: June 28, 2012, 08:22:14 pm by jwalker »
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Updating WZGUILib
« Reply #116 on: June 29, 2012, 05:01:49 am »
Quote
I get an error that global gc has been indexed so I know something isnt working.

Something like, "Attempt to index nil value gc" ?
Well, maybe you just forgot to add gc to the function parameter ?

Edit:
BTW, assert doesn't run a Lua chunk/function. It just checks that it's not nil. So you would need to do assert(chunkname, "chunk is nil")()
« Last Edit: June 29, 2012, 07:39:36 am by jimbauwens »

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #117 on: June 29, 2012, 11:02:17 am »
yea I get that error, and the example you have shown is how I have it in my code.
It runs the string from on.paint, so I didnt forget gc.
I have also ran the string like this:
loadstring(string)()
and
func = loadstring(string)
func()
I also tried passing gc to each of those things and it failed

Also I have attatched the new files
« Last Edit: June 29, 2012, 11:35:18 am by jwalker »
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline someone

  • LV3 Member (Next: 100)
  • ***
  • Posts: 49
  • Rating: +9/-0
    • View Profile
Re: Updating WZGUILib
« Reply #118 on: June 29, 2012, 02:33:30 pm »
Seems like the problem is on the function "string.sub". It might not be loading it when you open the file or something.

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: Updating WZGUILib
« Reply #119 on: June 29, 2012, 03:48:43 pm »
No, I only use string.sub to display the end part of the error message created by pcall()
« Last Edit: June 29, 2012, 03:50:55 pm by jwalker »
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads