(self, master, wrap=NONE, **kwargs)
Create a frame for Textview.

        master - master widget for this frame
        wrap - type of text wrapping to use ('word', 'char' or 'none')

        All parameters except for 'wrap' are passed to Frame.__init__().

        The Text widget is accessible via the 'text' attribute.

        Note: Changing the wrapping mode of the text widget after
        instantiation is not supported.
Create a frame for Textview.
Create a frame for Textview .
def __init__(self, master, wrap=NONE, **kwargs):
        """Create a frame for Textview.

        master - master widget for this frame
        wrap - type of text wrapping to use ('word', 'char' or 'none')

        All parameters except for 'wrap' are passed to Frame.__init__().

        The Text widget is accessible via the 'text' attribute.

        Note: Changing the wrapping mode of the text widget after
        instantiation is not supported.
        """
        super().__init__(master, **kwargs)

        text = self.text = Text(self, wrap=wrap)
        text.grid(row=0, column=0, sticky=NSEW)
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        # vertical scrollbar
        self.yscroll = AutoHideScrollbar(self, orient=VERTICAL,
                                         takefocus=False,
                                         command=text.yview)
        self.yscroll.grid(row=0, column=1, sticky=NS)
        text['yscrollcommand'] = self.yscroll.set

        # horizontal scrollbar - only when wrap is set to NONE
        if wrap == NONE:
            self.xscroll = AutoHideScrollbar(self, orient=HORIZONTAL,
                                             takefocus=False,
                                             command=text.xview)
            self.xscroll.grid(row=1, column=0, sticky=EW)
            text['xscrollcommand'] = self.xscroll.set
        else:
            self.xscroll = None
def __init__ ( self , master , wrap = NONE , * * kwargs ) : super ( ) . __init__ ( master , * * kwargs ) text = self . text = Text ( self , wrap = wrap ) text . grid ( row = 0 , column = 0 , sticky = NSEW ) self . grid_rowconfigure ( 0 , weight = 1 ) self . grid_columnconfigure ( 0 , weight = 1 ) # vertical scrollbar self . yscroll = AutoHideScrollbar ( self , orient = VERTICAL , takefocus = False , command = text . yview ) self . yscroll . grid ( row = 0 , column = 1 , sticky = NS ) text [ 'yscrollcommand' ] = self . yscroll . set # horizontal scrollbar - only when wrap is set to NONE if wrap == NONE : self . xscroll = AutoHideScrollbar ( self , orient = HORIZONTAL , takefocus = False , command = text . xview ) self . xscroll . grid ( row = 1 , column = 0 , sticky = EW ) text [ 'xscrollcommand' ] = self . xscroll . set else : self . xscroll = None