Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Girres42 on September 25, 2022, 02:22:22 pm

Title: Function 'on.paint' only running when the page number is clicked
Post by: Girres42 on September 25, 2022, 02:22:22 pm
On my Ti-nspire CX II, the on.paint function only runs when I click the page number. It works fine on the student software.
Title: Re: Function 'on.paint' only running when the page number is clicked
Post by: chalex on September 25, 2022, 04:34:09 pm
On my Ti-nspire CX II, the on.paint function only runs when I click the page number. It works fine on the student software.
I won't pretend I know how this really works, but the way I see it the paint function is called when events are triggered, and also when platform.window:invalidate() is called. You can add this code and it should refresh automatically without input:

Code: [Select]
timer.start(0.01)
function on.timer()
        platform.window:invalidate() --refreshes screen
end

Be warned about using this method though, switching off the handheld while the timer is running will cause it to freeze.