def run(): import testopt opts = testopt.parseCommandLine(800, 600) pyui.init(*opts) g = game() pyui.run()
def run(): width = 400 height = 300 pyui.init(width, height) app = Application(width, height) app.run() pyui.quit()
def run(): done = 1 frame = 0 t = time.time() import testopt opts = testopt.parseCommandLine(640, 480) pyui.init(*opts) g = app() while done: pyui.draw() now = int(time.time()) if now != t: print frame frame = 0 t = now frame = frame + 1 done = pyui.update() print "done X" g.cleanup() pyui.quit() print "quit."
def run(): width = 800 height = 600 pyui.init(width, height, "p3d", 0) app = Application(width, height) app.run() pyui.quit()
def init(): pyui.init(width, height, "p3d", fullscreen=0, title="CodeWorld") getRenderer().setBackMethod(render) getDesktop().registerHandler(pyui.locals.KEYDOWN, keyDown) pygame.key.set_repeat(500, 30) initGL()
def run(): opts = testopt.parseCommandLine(800, 600) done = 1 frame = 0 t = time.time() pyui.init(*opts) pyui.desktop.getRenderer().setMouseCursor("cursor.png", 11,7) w = pyui.widgets.Frame(50, 50, 600, 450, "clipme") g = pyui.grid.GridPanel(6,10) for i in range(0,10): g.putCellAt( pyui.widgets.Button("button #%d" % i, None), random.randrange(0,4), random.randrange(0,5) ) g.putCellAt( pyui.widgets.Label("label #%d" % i), random.randrange(0,4), random.randrange(5,10) ) g.putCellAt( pyui.widgets.Edit("label #%d" % i, 12, None), random.randrange(0,4), random.randrange(10,15) ) g.putCellAt( pyui.widgets.SliderBar(onbutton, 50, 30), random.randrange(0,4), random.randrange(15,20) ) w.replacePanel(g) w.pack() pyui.run() print "done" pyui.quit()
def run(): done = 1 frame = 0 t = time.time() import testopt opts = testopt.parseCommandLine(800, 600, "dx") pyui.init(*opts) # w = pyui.widgets.ViewWindow(10, 10, 400, 300) # w.pack() terrainDetails = CreateTestTerrainDetails() terrain = PyUnseen.createTerrainRegion(terrainDetails) # will take dictionary of stuff rootWorld = PyUnseen.getRootWorld() PyUnseen.addToWorld(rootWorld, terrain) # just like any other object cameraPos = (-10, 6, -10) cameraDir = (45, -45, 0) view1 = PyUnseen.createView(rootWorld) # will also take zMin, zMax? PyUnseen.setCameraParameters(view1, cameraPos, cameraDir) rootView = PyUnseen.getRootView() PyUnseen.setCameraParameters(rootView, cameraPos, cameraDir) while done: pyui.draw() done = pyui.update() print "done" pyui.quit()
def init(): pyui.init(width, height, 'p3d', fullscreen = 0, title = "CodeWorld") getRenderer().setBackMethod(render) getDesktop().registerHandler(pyui.locals.KEYDOWN, keyDown) pygame.key.set_repeat(500, 30) initGL()
def run(width, height, window, psyco, sound, server='http://localhost:8000', galaxy='', empire='', password=''): # Import Psyco if available if psyco: try: import psyco psyco.full() except ImportError: pass pyui.init( width, height, 'p3d', window, 'Armada Net Wars - version: %s' % anwp.func.globals.currentVersion) # read ini file for connection to server try: fileName = '%s/connect.ini' % os.getcwd() input = open(fileName, 'r') inputLines = [L.rstrip() for L in input] input.close() except: inputLines = ['http://localhost:8888'] app = anwp.client.app.Application(width, height, inputLines, sound, server, galaxy, empire, password) app.run() pyui.quit()
def main(): """Run gui for testing""" import run import anwp.func.storedata width = 1024 height = 768 myGalaxy = anwp.func.storedata.loadFromFile('../../../Database/ANW1.anw') myShip = myGalaxy.ships['1'] pyui.init(width, height, 'p3d', 0, 'Testing Quad Info Panel') app = run.TestApplication(width, height) i = 0 top = 70 width = (width / 4) - 20 height = height / 3 dimensions = [(0, height, width, height), (width + 10, top, width, height), (width * 2 + 20, height, width, height), (width + 10, top + height + 150, width, height)] for position in ['aft', 'fore', 'port', 'star']: (x, y, w, h) = dimensions[i] myQuad = myShip.quads[position] frame = QuadInfoFrame(None, app, myQuad, x, y, w, h) app.addGui(frame) i += 1 app.run() pyui.quit()
def run(): width = 800 height = 600 pyui.init(width, height) app = Application(width, height) app.run() app = None pyui.quit()
def run(): done = 1 import testopt opts = testopt.parseCommandLine(800, 600) pyui.init(*opts) g = app() pyui.run()
def run(): done = 1 frame = 0 t = time.time() import testopt opts = testopt.parseCommandLine(800, 600) pyui.init(*opts) g = game() pyui.run()
def main(): """Run gui for testing""" import run width = 1280 height = 1024 pyui.init(width, height, 'p3d', 0, 'Testing SimMenu Panel') app = run.TestApplication(width, height) frame = SimMenu(None, app) app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0) app = run.TestApplication(width, height) frame = MessageBox(None, app, 'Test MessageBox', 'Test of a Message Box') app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing Industry Panel') app = run.TestApplication(width, height) frame = AddIndustryFrame(None, app, 'Add Industry to System', '1') app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing MainMenuTech Panel') app = run.TestApplication(width, height) frame = MainMenuTech(None, app) app.addGui(frame) app.run() pyui.quit()
def __init__(self): opts = testopt.parseCommandLine(800, 600) pyui.init(800,600,"p3d") ## DB init stuff self.dbpool = adbapi.ConnectionPool("pyPgSQL.PgSQL", "sean", host="localhost:5432") self.application = app.Application("testApp") self.reflector = sqlreflector.SQLReflector(self.dbpool, [], self.makeGrids) main.addTimeout(self.tick, 0.001) # make sure we can be shut down on windows. self.application.run()
def main(): """Run gui for testing""" import run width = 1024 height = 768 dTrade = {'AL': 100.0, 'EC': 100.0, 'IA': 100.0} pyui.init(width, height, 'p3d', 0, 'Testing Trade Panel') app = run.TestApplication(width, height) frame = ViewTrade(None, app, 100, 100, dTrade) app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing Armada Info Panel') app = run.TestApplication(width, height) frame = ArmadaInfoFrame(None, app) frame.panel.populate(None, None) app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing Send Mail Info Panel') app = run.TestApplication(width, height) empireDict = {'id': '1', 'name': 'Test Empire'} frame = SendMailInfoFrame(None, app, empireDict) app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing Grid Panel') app = run.TestApplication(width, height) ##frame = GetGridFrame(None, app, 5, 20, 'Select Grid Quadrant for Fleet') frame = GetGridFrame(None, app, 3, 6, 'Select Map Quadrant for Fleet') app.addGui(frame) app.run() pyui.quit()
def run(): """The main game loop.""" done = 1 global sx, sy pyui.init(sx, sy, "p3d") #pyui.core.setTheme(pyui.theme.uglyTheme()) g = game() while done: pyui.draw() done = pyui.update() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 empireDict = {'id':'1', 'name':'Test Empire'} pyui.init(width, height, 'p3d', 0, 'Testing EmpireDip Panel') app = run.TestApplication(width, height) frame = EmpireDipFrame(None, app, empireDict, 10, 10) app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 myTech = {'name': 'Intelligent Shipyards', 'currentPoints': 0, 'imageFile': 'tech_red', 'y': 1800, 'id': '216', 'preTechs': ['216'], 'complete': 0, 'requiredPoints': 400, 'x': 300, 'preTechNum': 1, 'techAge': 3, 'description': 'Intelligent Shipyards'} pyui.init(width, height, 'p3d', 0, 'Testing Tech Info Panel') app = run.TestApplication(width, height) frame = TechInfoFrame(None, app) frame.panel.populate(myTech) app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing Mail Info Panel') app = run.TestApplication(width, height) frame = MailInfoFrame(None, app) app.addGui(frame) frame2 = MailBodyFrame(None, app, '1') app.addGui(frame) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing City Panel') app = run.TestApplication(width, height) ##frame = AddCityFrame(None, app, 'Add City', '0', '1', 'Colin') frame = AddCityFrame(None, app, 'Change City Resource', [11, 20, 14, 25, 18], '1', 'Colin') app.addGui(frame) app.run() pyui.quit()
def run(): import testopt opts = testopt.parseCommandLine(800, 600) pyui.init(*opts) cubeSetup() pyui.desktop.getRenderer().setBackMethod(drawCube) createControl() con = pyui.dialogs.Console(0,500,780,80) pyui.run() print "done X" pyui.quit() print "quit."
def run(): import testopt opts = testopt.parseCommandLine(800, 600) pyui.init(*opts) # pyui.core.setTheme(pyui.greenTheme.greenTheme(pyui.core.gRenderer, 640, 480)) g = app() pyui.run() print "done X" g.cleanup() pyui.quit() print "quit."
def main(): """Run gui for testing""" import run import anwp.func.storedata width = 1024 height = 768 myGalaxy = anwp.func.storedata.loadFromFile('../../../Database/ANW.anw') myShip = myGalaxy.ships['1'] pyui.init(width, height, 'p3d', 0, 'Testing Ship Info Panel') app = run.TestApplication(width, height) frame = ShipInfoFrame(None, app, myShip) frame.panel.populate() app.addGui(frame) app.run() pyui.quit()
def run(self): self.running = 1 not_done = 1 pyui.init(800, 600, fullscreen=1) for wrapper in wrappers: wrapper.prod() while not_done: pyui.draw() not_done = pyui.update() pyui.quit()
def main(): """Run gui for testing""" import anwp.gui.run import anwp.client.game import anwp.modes.mode width = 1024 height = 768 pyui.init(width, height, 'p3d', 0, 'Testing Footer Panel') app = anwp.gui.run.TestApplication(width, height) game = anwp.client.game.TestGame(app, width, height) mode = anwp.modes.mode.TestMode(game) window = Footer(mode, app) app.addGui(window) app.run() pyui.quit()
def main(): """Run gui for testing""" import run width = 1024 height = 768 myEmpire = {'imageFile':'testempire', 'name': 'Kurita', 'ip': '', 'AL': 0, 'EC': 0, 'color1': 'red', 'simulationsLeft': 0, 'color1': 'black', 'emailAddress': '', 'key': '', 'designsLeft': 0, 'IA': 0, 'CR': 0, 'cities': 10} dIndustry = {'1':'Factory-1', '3':'Research Center-1', '2':'Marine Academy-2'} dShips = {'1':'5 Scouts', '2':'10 Destroyers', '3':'3 Super Dreadnoughts'} dMarines = {'1':'10 Flamers', '2':'10 Strikers', '3':'5 Gunners'} myIntelReport = {'round':99, 'industryReport':dIndustry, 'shipReport':dShips, 'marineReport':dMarines} mySystem = {'intelReport':myIntelReport, 'AL':12032, 'EC':455, 'IA':54, 'name': 'Hannah', 'imageFile': 'sys_8_yellow_black', 'id': '1001', 'connectedSystems': [], 'y': 300, 'x': 200, 'cities': 10, 'citiesUsed':4, 'myEmpireID': '2'} systemID = '1000' pyui.init(width, height, 'p3d', 0, 'Testing System Info Panel') app = run.TestApplication(width, height) frame = SystemInfoFrame(None, app) frame.panel.populate(myEmpire, mySystem) app.addGui(frame) app.run() pyui.quit()
def install(ms=10, reactor=None, args=(), kw={}): """ Schedule PyUI's display to be updated approximately every C{ms} milliseconds, and initialize PyUI with the specified arguments. """ d = pyui.init(*args, **kw) if reactor is None: from twisted.internet import reactor _guiUpdate(reactor, ms / 1000.0) return d
def run(): done = 1 frame = 0 t = time.time() import testopt opts = testopt.parseCommandLine(800, 600) pyui.init(*opts) w = pyui.widgets.WorldWindow(50, 50, 400, 400) w.pack() while done: pyui.draw() done = pyui.update() print "done" pyui.quit()
def __init__(self): pyui.init(*(800, 600, 'gl', 0)) self.shaders = {} self.timerCalls = [] self.renderCalls = [] self.projection = array([ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ], np.float32) #glutInit() #glutInitWindowSize(640,480) #glutCreateWindow("SBD Simulator") glEnable(GL_DEPTH_TEST) glDepthMask(GL_TRUE) glClearColor(0.9, 0.9, 0.9, 1.0) glClearDepth(1) glDepthFunc(GL_LEQUAL) glViewport(0, 0, 640, 480) #glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) pyui.desktop.getRenderer().setBackMethod(self.onTimer)
def __init__(self): pyui.init(*(800,600,'gl',0)) self.shaders = {} self.timerCalls = [] self.renderCalls = [] self.projection = array([1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], np.float32) #glutInit() #glutInitWindowSize(640,480) #glutCreateWindow("SBD Simulator") glEnable(GL_DEPTH_TEST) glDepthMask(GL_TRUE) glClearColor(0.9,0.9,0.9,1.0) glClearDepth(1) glDepthFunc(GL_LEQUAL) glViewport(0,0,640,480) #glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) pyui.desktop.getRenderer().setBackMethod(self.onTimer)
def run(): opts = testopt.parseCommandLine(800, 600) done = 1 frame = 0 t = time.time() pyui.init(*opts) pyui.desktop.getRenderer().setMouseCursor("cursor.png", 11, 7) for i in range(0, 1): w = pyui.widgets.Frame(50 + i * 20, 50 + i * 20, 400, 400, "spreadsheet") w.setLayout(pyui.layouts.GridLayoutManager(1, 1, 0)) b = pyui.sheet.Sheet(onChanged, onInserted) b.setColumnTitle(3, "A very Long one") b.setColumnTitle(2, "Table name") b.setColumnTitle(1, "Something goes here....") w.addChild(b) w.pack() pyui.run() print "done" pyui.quit()
def run(): opts = testopt.parseCommandLine(1024, 768) done = 1 frame = 0 t = time.time() pyui.init(*opts) w = pyui.widgets.Frame(0,0,800,600, "HTML!") h = pyui.html.HTMLPanel() w.replacePanel(h) w.pack() #f = open('C:/ninja/Projects/pyui/website/index.html') #text = f.read() #f.close() h.feed(text) #h.feed(testText) w.resize(800,600) pyui.run() print "done" pyui.quit()
from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. """ import pyui import console import sylphis import configfile import cmdline res = configfile.gCfgFile.r_videomode if res == 2: pyui.init(800, 600) elif res == 3: pyui.init(1024, 768) elif res == 4: pyui.init(1152, 864) elif res == 5: pyui.init(1280, 1024) else: pyui.init(640, 480) from menus import menubar con = console.CConsole(30, 30, 480, 300) con.show = 0 if hasattr(configfile.gCfgFile, 'startup_dialog'):
For more Row Classes to experiment with see the row* files in doc/examples directory of the Twisted Distribution. Note that this test requires a Postgresql Relational database called "sean" on the local machine , and the schema that is created by the file twisted/enterprise/schem.sql in the Twisted distribution. """ def tick(): main.addTimeout(tick, 0.5) if __name__ == '__main__': # init pyui pyui.init(800,600, "p3d") # init db stuff dbpool = adbapi.ConnectionPool("pyPgSQL.PgSQL", database="sean", host="localhost", port=5432) reflector = sqlreflector.SQLReflector(dbpool, [IdentityRow, PerspectiveRow]) reflector._transPopulateSchema(None) # make sure we can be shut down on windows. main.addTimeout(tick, 0.5) # create the boat frame w = pyui.boat.BoatReflectorFrame(reflector, 0,0,790, 570) # run the main loop last = 0 frame = 0
def setUp(self): global started if started == 0: pyui.init(640,480,"p3d") started = 1 self.frame = pyui.widgets.Frame(0, 0, 300, 300, "Test Frame")
from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. """ import pyui import console import sylphis import configfile import cmdline res = configfile.gCfgFile.r_videomode if res == 2: pyui.init(800, 600) elif res == 3: pyui.init(1024, 768) elif res == 4: pyui.init(1152, 864) elif res == 5: pyui.init(1280, 1024) else: pyui.init(640, 480) from menus import menubar con = console.CConsole(30, 30, 480, 300) con.show = 0 if hasattr(configfile.gCfgFile, "startup_dialog"):