TermTk.TTkCore.canvas

TTkCanvas

class TTkCanvas(*args, **kwargs)[source]

Init the Canvas object

Parameters
  • width – the width of the Canvas

  • height – the height of the Canvas

drawTTkString(pos, text, width=None, color=<TermTk.TTkCore.color._TTkColor object>, alignment=0, forceColor=False)[source]

NOTE: drawText is one of the most abused functions, there is some redundant code here in order to reduce the footprint

drawText(text='', pos=(0, 0), width=None, color=<TermTk.TTkCore.color._TTkColor object>, alignment=0, forceColor=False)[source]

NOTE: drawText is one of the most abused functions, there is some redundant code here in order to reduce the footprint

resize(w, h)[source]

resize the canvas keeping or cutting the current one

Parameters
  • w – the width of the new canvas

  • h – the height of the new canvas