#NEWLINE# def draw_screen( self , size , canvas ) : #NEWLINE# #INDENT# '\n\n        :param size:\n        :type canvas: urwid.Canvas\n        ' #NEWLINE# if ( not self . root ) : #NEWLINE# #INDENT# raise ManualShutdown ( 'GUI window was closed' ) #NEWLINE# #UNINDENT# self . text . config ( state = tkinter . NORMAL ) #NEWLINE# self . text . delete ( '1.0' , tkinter . END ) #NEWLINE# for ( idx , row ) in enumerate ( canvas . content ( ) ) : #NEWLINE# #INDENT# pos = 0 #NEWLINE# for part in row : #NEWLINE# #INDENT# txt = part [ 2 ] #NEWLINE# if isinstance ( txt , text_type ) : #NEWLINE# #INDENT# strlen = len ( txt ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# strlen = len ( txt . decode ( 'utf8' ) ) #NEWLINE# #UNINDENT# self . text . insert ( tkinter . END , txt ) #NEWLINE# if ( part [ 0 ] is not None ) : #NEWLINE# #INDENT# self . text . tag_add ( part [ 0 ] , ( '%s.%s' % ( ( idx + 1 ) , pos ) ) , ( '%s.%s' % ( ( idx + 1 ) , ( pos + strlen ) ) ) ) #NEWLINE# #UNINDENT# pos += strlen #NEWLINE# #UNINDENT# self . text . insert ( tkinter . END , '\n' ) #NEWLINE# #UNINDENT# self . text . config ( state = tkinter . DISABLED ) #NEWLINE# self . root . update ( )