WS_BORDER=0x800000 WS_CHILD=0x40000000 WS_CLIPCHILDREN=0x2000000 WS_EX_CLIENTEDGE=0x200 WS_GROUP=0x20000 WS_OVERLAPPEDWINDOW=0xcf0000 WS_VISIBLE=0x10000000 WS_VSCROLL=0x200000 PBM_SETPOS=WM_USER+2 PBM_SETRANGE=WM_USER+1 GetLastError = kernel32.GetLastError _verbose=0 if _verbose: setLogFile('/tmp/dbg.txt') def _lastErrorMessage(n=None): msg = windll.cstring('',512) kernel32.FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 0, n is None and GetLastError() or n, 0, msg.address(), len(msg)-1, 0 ) return repr(msg)[1:-1] class t_rect(structob.struct_object):
""" import manygui.backends.txtutils.txtwgts as tw import sys sys.stderr = open('error.txt','w') import os from manygui.backends import * from manygui.Applications import AbstractApplication from manygui.Wrappers import AbstractWrapper, DummyWidget, isDummy from manygui.Events import * from manygui.Exceptions import Error from manygui.Utils import log,setLogFile from manygui import application setLogFile("txtgui.log") def setScreenPackage(pkg): if pkg == "curses": from . import scr_curses tw._scr = scr_curses else: from . import scr_text tw._scr = scr_text setScale() def setScale(): x,y = tw._scr._xsize,tw._scr._ysize tw.set_scale(x,y) class ComponentWrapper(AbstractWrapper):
# Curses magic implemented on a dumb terminal. from manygui.backends import * from manygui.Utils import log, setLogFile setLogFile('textgui.txt') __all__ = ''' Application ButtonWrapper WindowWrapper LabelWrapper TextFieldWrapper TextAreaWrapper ListBoxWrapper RadioButtonWrapper CheckBoxWrapper '''.split() Application=1 ButtonWrapper=1 WindowWrapper=1 LabelWrapper=1 TextFieldWrapper=1 TextAreaWrapper=1 ListBoxWrapper=1 RadioButtonWrapper=1 CheckBoxWrapper=1
'''.split() Application=1 ButtonWrapper=1 WindowWrapper=1 LabelWrapper=1 TextFieldWrapper=1 TextAreaWrapper=1 ListBoxWrapper=1 RadioButtonWrapper=1 CheckBoxWrapper=1 from manygui.Exceptions import Error from manygui.Utils import setLogFile setLogFile('curses.txt') import sys import os if hasattr(sys,'ps1'): try: os.environ['ANYGUI_FORCE_CURSES'] except KeyError: raise ImportError("This appears to be an interactive session; curses disabled.") import atexit def _cleanup(): try: scr_curses.scr_quit() except: