Package tdl :: Class Window
[frames] | no frames]

Class Window

source code

  object --+    
           |    
_MetaConsole --+
               |
              Window

A Window contains a small isolated part of a Console.

Drawing on the Window draws on the Console.

Making a Window and setting its width or height to None will extend it to the edge of the console.

Instance Methods
 
__contains__(self, position)
Use ((x, y) in console) to check if a position is drawable on this console. (Inherited from tdl._MetaConsole)
source code
 
__init__(self, console, x, y, width, height)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
repr(x)
source code
 
blit(self, source, x=0, y=0, width=None, height=None, srcX=0, srcY=0)
Blit another console or Window onto the current console. (Inherited from tdl._MetaConsole)
source code
 
clear(self, fgcolor=(255, 255, 255), bgcolor=(0, 0, 0))
Clears the entire Window.
source code
 
drawChar(self, x, y, char, fgcolor=(255, 255, 255), bgcolor=(0, 0, 0))
Draws a single character. (Inherited from tdl._MetaConsole)
source code
 
drawFrame(self, x, y, width, height, string, fgcolor=(255, 255, 255), bgcolor=(0, 0, 0))
Similar to drawRect but only draws the outline of the rectangle. (Inherited from tdl._MetaConsole)
source code
 
drawRect(self, x, y, width, height, string, fgcolor=(255, 255, 255), bgcolor=(0, 0, 0))
Draws a rectangle starting from x and y and extending to width and height. (Inherited from tdl._MetaConsole)
source code
 
drawStr(self, x, y, string, fgcolor=(255, 255, 255), bgcolor=(0, 0, 0))
Draws a string starting at x and y. (Inherited from tdl._MetaConsole)
source code
(int, 3-item tuple, 3-item tuple)
getChar(self, x, y)
Return the character and colors of a cell as (ch, fg, bg)
source code
(int, int)
getSize(self)
Return the size of the console as (width, height) (Inherited from tdl._MetaConsole)
source code
 
scroll(self, x, y)
Scroll the contents of the console in the direction of x,y. (Inherited from tdl._MetaConsole)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  console
  height (Inherited from tdl._MetaConsole)
  parent
  width (Inherited from tdl._MetaConsole)
  x
  y

Inherited from object: __class__

Method Details

__init__(self, console, x, y, width, height)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

clear(self, fgcolor=(255, 255, 255), bgcolor=(0, 0, 0))

source code 

Clears the entire Window.

Parameters:
  • bgcolor (3-item list)
  • fgcolor (3-item list)