Skip to content

Instantly share code, notes, and snippets.

View tubaplayerdis's full-sized avatar
💭
Variadic Macro

Aaron Wilk tubaplayerdis

💭
Variadic Macro
View GitHub Profile
from UIKit import *
from ti_system import *
from ti_draw import *
#Initalize the canvas
init()
#Create slider
slider1 = Slider(100,30,90,30,-100,100,0,True)
from UIKit import *
from ti_system import *
from ti_draw import *
#Initalize the canvas
init()
#Create button and ignore the use of the proprietary callback system. This is not suggested though, as it is invoked before any logic takes place. It is only ignored here as an example
button1 = Button(100,30,100,20,"Click", None, None)
@tubaplayerdis
tubaplayerdis / colorpickerexample.py
Last active September 20, 2024 19:19
Example Use of Colorpicker
from UIKit import *
from ti_draw import *
from ti_system import *
#initalize UIKit
UIKit_Init()
#Create Elements
button1 = Button(20,180,100,20,"change my color!", None, None)
colpik = Colorpicker(10,10,Color(0,0,0))
@tubaplayerdis
tubaplayerdis / buttoncallback.py
Last active March 29, 2024 00:56
button callback example
from ti_system import *
from ti_draw import *
from UIKit import *
init()
def testfunc(arg):
#tests if the argument matches the text of the button
if canvas[0].text == arg:
@tubaplayerdis
tubaplayerdis / customelement.py
Last active September 24, 2024 15:06
custom element example
from UIKit import *
from ti_draw import *
from ti_system import *
class MyElement(UIElement):
def __init__(self, x, y, width, height, examplearg):
#all the vars below are from UIElement
self.x = x
self.y = y
self.width = width
@tubaplayerdis
tubaplayerdis / gettingstarted.py
Last active September 24, 2024 16:25
Code to get started using UIKit for the TI-nspire
from ti_system import *
from ti_draw import *
from UIKit import *
#initalizes the drawing space for canvas
init()
#Create the Label Element. the label1 varaible still holds refrence to the object in the canvas and can be treated as such
label1 = Label(40, 120, "Hello World")
#append any elemnts you want to the canvas, in this case, a label