Skip to content

Simple Code (Gui style)

kuko0411 edited this page Jan 5, 2013 · 2 revisions
import gui, pygame                                          #import the library
screen = gui.screen.Screen ((1000, 1000))                   #Get the drawing surface

Button1 = gui.button.Button()                               #define new button
Button1.topleft = (20, 50)                                  #move the button on right place
Button1.size    = (200, 420)
Button1.caption = "Do something"

@gui.membermethod (Button1)                                 #tell to what widget the method belongs
def onMouseButtonUp (self, event):                          #define what happens on click
    self.caption = "Done something"

gui.loop()                                                  #run the gui
Clone this wiki locally