Here is a quick heavily annoted example to get you started.
#import uxPython GUI library from uxGUI import * #create a class that inherets from uxpWindow class myWindow(uxWindow): #create a method with name "init", it is called automatically def init(self): #set window caption self.caption = "Minimal" #container to put controls/widgets in #optional the window is also a container panel = uPanel(None,self) #First argument is ID and second the parent #set x,y since a window's default layout is Absolute panel.x = 50 panel.y = 50 #set width and height panel.height = 250 panel.width = 250 #widgets support a css like styling system panel.style.background = "#FFFFFF" #create a button self.b = b = uButton(None,panel) #with panel as parent #add an event click in this case, b.addEvent('click',self.click,True,b) #True for async, b is a parameter #create a label self.lbl = lbl = uLabel('lbl',panel) lbl.text = "Hello World!" #alternate way of setting style lbl.style.css = 'width: 100%;' #the button and label does not have a x,y #since the default layout of a panel is Flow #so it will just pack widgets in according to width and height #in a flowing manner. #event handlers should have the following structure, #the e arg is an Event object with info about the event def click(self,e): #launch animation of the width attribute #widget.animate(attrname,from,to,duration in seconds) self.b.animate('width',self.b.width,self.b.width+50,2) #change text self.lbl.text = "Around the Hello World in 80 days" #create an instance of the window uw = myWindow() #run the application uw.app.run()
uxPython provides python programmers with the kind of expressiveness usually only found in platform specific API but without the OS lockdown and complexity.
Download it here