def __init__(self, x, y, w, h, topmost = 0): Window.__init__(self, x, y, w, h, topmost) self.setLayout(pyui.layouts.BorderLayoutManager()) fields = [ ('string', 'user', 'Name:', 24, 5), ('password', 'pass', 'Password:'******'checkbox', 'guest', '', 24, 'Login as a guest?') ] self.form = FormPanel(fields) self.form.widget_user.handler = self.doLogin self.form.widget_pass.handler = self.doLogin self.registerEvent(pyui.locals.KEYDOWN, self._pyuiKeyDown) self.login = Button('Login', self.doLogin) self.create = Button('Create Account', self.doLogin) self.botPanel = Panel() self.botPanel.addChild(self.login) self.botPanel.addChild(self.create) self.addChild(self.form, pyui.locals.CENTER) self.addChild(self.botPanel, pyui.locals.SOUTH) self.pack() self.form.widget_user.getFocus()
def __init__(self): Window.__init__(self, 0, getDesktop().height - 24, getDesktop().width, 24, topmost=1) self.setLayout(pyui.layouts.BorderLayoutManager()) self.command = Edit("Enter commands here.", 255, self.enter) self.addChild(self.command, pyui.locals.CENTER) self.pack()
def __init__(self, x, y, w, h, topmost=0): Window.__init__(self, x, y, w, h, topmost) self.setLayout(pyui.layouts.BorderLayoutManager()) fields = [('string', 'user', 'Name:', 24, 5), ('password', 'pass', 'Password:'******'checkbox', 'guest', '', 24, 'Login as a guest?')] self.form = FormPanel(fields) self.form.widget_user.handler = self.doLogin self.form.widget_pass.handler = self.doLogin self.registerEvent(pyui.locals.KEYDOWN, self._pyuiKeyDown) self.login = Button('Login', self.doLogin) self.create = Button('Create Account', self.doLogin) self.botPanel = Panel() self.botPanel.addChild(self.login) self.botPanel.addChild(self.create) self.addChild(self.form, pyui.locals.CENTER) self.addChild(self.botPanel, pyui.locals.SOUTH) self.pack() self.form.widget_user.getFocus()
def __init__(self): Window.__init__(self, 0, 0, getDesktop().width, \ getDesktop().height/4, topmost = 1) self.setLayout(pyui.layouts.BorderLayoutManager()) self.outputBox = LineDisplay() self.addChild(self.outputBox, pyui.locals.CENTER) self.pack() Events.addCallbacks('keyDown', self.keyDown) self.oldout = sys.stdout sys.stdout = self