jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
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.
|
|
|
|
Logged
|
|
|
|
adriweb
Editor
LV9 Veteran (Next: 1337)
Offline
Gender: 
Last Login: Today at 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197
Total Post Ratings: +185
|
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  (Edit: or is it directly the UseThisFile.lua ? )
|
|
|
|
« Last Edit: 18 June, 2012, 00:33:44 by adriweb »
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
It is Directly using the UseThisFile.lua file that that is located in page 7, I just changed on.create to on.construction
|
|
|
|
|
Logged
|
|
|
|
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
Offline
Gender: 
Last Login: Today at 13:04:25
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733
Total Post Ratings: +180
|
Is the problem related to the "middle" in gc:drawString 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: 18 June, 2012, 08:22:36 by jimbauwens »
|
Logged
|
|
|
|
adriweb
Editor
LV9 Veteran (Next: 1337)
Offline
Gender: 
Last Login: Today at 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197
Total Post Ratings: +185
|
I just put that up on Inspired-Lua's gc:drawString : 
|
|
|
|
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
the problem is related to middle, thanks for the help
|
|
|
|
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
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.
|
|
|
|
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
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.
|
|
|
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
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.
|
|
|
|
Logged
|
|
|
|
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
Offline
Gender: 
Last Login: Today at 13:04:25
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733
Total Post Ratings: +180
|
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.
|
|
|
|
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
thanks, maybe its a student software bug?
|
|
|
|
« Last Edit: 29 June, 2012, 02:22:14 by jwalker »
|
Logged
|
|
|
|
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
Offline
Gender: 
Last Login: Today at 13:04:25
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733
Total Post Ratings: +180
|
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: 29 June, 2012, 13:39:36 by jimbauwens »
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
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: 29 June, 2012, 17:35:18 by jwalker »
|
Logged
|
|
|
|
someone
LV3 Member (Next: 100)
 
Offline
Gender: 
Last Login: Yesterday at 19:10:23
Date Registered: 12 January, 2012, 19:07:23
Posts: 48
Total Post Ratings: +9
|
Seems like the problem is on the function "string.sub". It might not be loading it when you open the file or something.
|
|
|
|
|
Logged
|
|
|
|
jwalker
LV7 Elite (Next: 700)
     
Offline
Gender: 
Last Login: Today at 07:05:32
Date Registered: 20 December, 2011, 00:20:52
Location: its cold outside
Posts: 605
Topic starter
Total Post Ratings: +11
|
No, I only use string.sub to display the end part of the error message created by pcall()
|
|
|
|
« Last Edit: 29 June, 2012, 21:50:55 by jwalker »
|
Logged
|
|
|
|
|