

def update(self, pygsurfObj=None):
    '\n        Draw the PygcurseInput object to the PygcurseSurface object associated with it (in the self.pygsurf member) or to the pygsurfObj argument.\n\n        This method handles drawing the prompt, typed in text, and cursor of this object.\n        '
    if ((pygsurfObj is not None) and (pygsurfObj._pygcurseClass in ('PygcurseWindow', 'PygcurseSurface'))):
        pygsurfObj = pygsurfObj.surface
    elif (self.pygsurf is not None):
        pygsurfObj = self.pygsurf
    else:
        raise Exception('No PygcurseSurface object specified to draw the PygcurseWindow object to.')
    if (self.lastScrollCount < pygsurfObj._scrollcount):
        self.starty -= (pygsurfObj._scrollcount - self.lastScrollCount)
    if self.multiline:
        pygsurfObj.pushcursor()
        if (self.eraseBufferSize is not None):
            pygsurfObj.write((self.prompt + (' ' * self.eraseBufferSize)))
            pygsurfObj.popcursor()
            pygsurfObj.pushcursor()
            self.eraseBufferSize = None
        pygsurfObj.write(self.prompt, fgcolor=self._promptfgcolor, bgcolor=self._promptbgcolor)
        pygsurfObj.write((''.join(self.buffer) + ' '), fgcolor=self._fgcolor, bgcolor=self._bgcolor)
        (afterPromptX, afterPromptY) = pygsurfObj.getnthcellfrom(self.startx, self.starty, len(self.prompt))
        pygsurfObj.inputcursor = pygsurfObj.getnthcellfrom(afterPromptX, afterPromptY, self.cursor)
        numToPrint._drawinputcursor()
        pygsurfObj.popcursor()
    else:
        if (self.eraseBufferSize is not None):
            tempcursorx = self.startx
            while ((tempcursorx < pygsurfObj.width) and (tempcursorx < ((self.startx + len(self.prompt)) + eraseBufferSize))):
                pygsurfObj.putchar(' ', tempcursorx, self.starty)
                tempcursorx += 1
            self.eraseBufferSize = None
        numToPrint = ((self._width - self.startx) - 1)
        pygsurfObj.putchars((self.prompt + ''.join(self.buffer))[:numToPrint], self.startx, self.starty, fgcolor=self._fgcolor, bgcolor=self._bgcolor)
        pygsurfObj.inputcursor = pygsurfObj.getnthcellfrom(self.startx, self.starty, self.cursor)
        pygsurfObj._drawinputcursor()

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py PygcurseInput.update/VarMisuse@262/499 `pygsurfObj`->`numToPrint`