def errorreport(widtitle, area, err): global scupdate launchutils.consolewrite(">>ERROR in: \"" + widtitle + "\" terminating") launchutils.consolewrite(">>Area: " + area) print(traceback.format_exc()) errdiagtxt = ("Error In: \"" + widtitle + "\" terminating... \n Area: " + area + " \n see Standard output for traceback. \n\"" + str(err) + "\"") vmui.okdiag(errdiagtxt, (screenx // 2), (screeny // 2)) for errline in vmui.listline(str(err)): launchutils.consolewrite(errline) scupdate = 1
#onscreen button handler (blitted to background image during startup) #help button if filemenux.collidepoint(event.pos) == 1 and event.button == 1: menuret = vmui.menuset(filemenu, 3, 45, reclick=0, fontsize=26) if menuret == "HELP": subprocess.Popen(["python", "helpview.py", "fileview.xml"]) if menuret == "QUIT": quitflag = 1 break if menuret == "ABOUT": if panemode == 2: vmui.aboutdiag(diagabt, (screenx // 2), (screeny // 2)) else: vmui.okdiag(diagabt, (screenx // 2), (screeny // 2)) if menuret == "SETBG": vmui.settheme(3, 45) scupdate = 1 filebg = (libthemeconf.bgmake(filehud)).convert() if menuret == "NEW": subprocess.Popen(["python", "fileview2.py"]) if panex.collidepoint(event.pos) == 1 and event.button == 1: if panemode == 1: panemode = 2 screensurf = pygame.display.set_mode((800, 600)) scupdate = 1 screenx = 800 screeny = 600 hudupdate = 1 else:
scupdate = 1 if bgx.collidepoint(event.pos) == 1 and event.button == 1: vmui.settheme(bgxy, 45, nosave=1) curbg = int(libthemeconf.getconf("desk", "bgtheme")) curbgname = vmui.getbgname(curbg) scupdate = 1 if fmx.collidepoint(event.pos) == 1 and event.button == 1: menuret = vmui.menuset(filemenu, fmxy, 45, reclick=0, fontsize=26) if menuret == "HELP": subprocess.Popen(["python", "helpview.py", "theme.xml"]) if menuret == "SAVE": libthemeconf.saveconf() vmui.okdiag(themenot, (screenx // 2), (screeny // 2)) if menuret == "RESET": libthemeconf.resetconf() curtheme = libthemeconf.getconf("theme", "themefile") curthemename = (libthemeconf.getthemeinfo(curtheme))[0] curbg = int(libthemeconf.getconf("desk", "bgtheme")) curbgname = vmui.getbgname(curbg) #frameskip selector code print "dxreset" scupdate = 1 if menuret == "QUIT": qflg = 1 break
screensurf.blit(vscroll[1], (60, 60)) textinpout = vmui.textinput(4, 210) print "Input has returned:" print textinpout if cmd == "okdiag": vmui.toolsscreen(1) #note: to center dialog in a pygame window use half the window width as xpos, #and half the window height as ypos screenw = 800 screenh = 600 xpos = (screenw // 2) ypos = (screenh // 2) diagtext = '''This is a test. of vmui.okdiag() a function to create OK dialogs.''' diagout = vmui.okdiag(diagtext, xpos, ypos) print "ok dialog has returned:" print diagout diagout = vmui.okdiag("test", xpos, ypos) print "ok dialog 2 has returned:" print diagout if cmd == "yndiag": vmui.toolsscreen(1) #note: to center dialog in a pygame window use half the window width as xpos, #and half the window height as ypos screenw = 800 screenh = 600 xpos = (screenw // 2) ypos = (screenh // 2) diagtext = '''This is a test. of vmui.yndiag()