Skip to content

Commit

Permalink
Removed unnecessary class
Browse files Browse the repository at this point in the history
Signed-off-by: obulat <[email protected]>
  • Loading branch information
obulat committed May 10, 2018
1 parent 6a1f9aa commit 8f8f9aa
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/winforms/toga_winforms/widgets/textinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,10 @@
from .base import Widget


class TogaTextInput(WinForms.TextBox):
def __init__(self, interface):
super().__init__()
self.Multiline = False
self.interface = interface

def on_text_change(self, sender, event):
if self.interface._on_change:
self.interface.on_change(self.interface)


class TextInput(Widget):
def create(self):
self.native = TogaTextInput(self.interface)
self.native = WinForms.TextBox()
self.native.Multiline = False

def set_readonly(self, value):
self.native.ReadOnly = value
Expand All @@ -32,7 +22,6 @@ def set_value(self, value):
self.native.Text = value

def set_alignment(self, value):
print('Alignment: ', value)
if value == 'center':
win_value = WinForms.HorizontalAlignment.Center
elif value == 'left':
Expand All @@ -55,4 +44,8 @@ def rehint(self):
self.interface.intrinsic.height = self.native.PreferredSize.Height

def set_on_change(self, handler):
self.native.TextChanged += self.native.on_text_change
self.native.TextChanged += self.on_text_change

def on_text_change(self, sender, event):
if self.interface._on_change:
self.interface.on_change(self.interface)

0 comments on commit 8f8f9aa

Please sign in to comment.