

def init(self, parent):
    ' Finishes initializing the editor by creating the underlying toolkit\n            widget.\n        '
    factory = self.factory
    style = self.base_style
    self.evaluate = factory.evaluate
    self.sync_value(factory.evaluate_name, 'evaluate', 'from')
    if ((not factory.multi_line) or factory.password):
        style &= (~ wx.TE_MULTILINE)
    if factory.password:
        style |= wx.TE_PASSWORD
    multi_line = ((style & wx.TE_MULTILINE) != 0)
    if multi_line:
        self.scrollable = True
    if (factory.enter_set and (not multi_line)):
        control = wx.TextCtrl(parent, (- 1), self.str_value, style=(style | wx.TE_PROCESS_ENTER))
        wx.EVT_TEXT_ENTER(parent, control.GetId(), self.update_object)
    else:
        control = wx.TextCtrl(parent, (- 1), self.str_value, style=style)
    wx.EVT_KILL_FOCUS(control, self.update_object)
    if factory.auto_set:
        wx.EVT_TEXT(parent, control.GetId(), self.update_object)
    self.control = control
    self.set_error_state(False)
    self.set_tooltip()

dataset/ETHPy150Open enthought/traitsui/traitsui/wx/text_editor.py SimpleEditor.init/original