Browse Source

Fix text wrapping in 1.0.3-release

This fixes the problem reported in https://github.com/chriskiehl/Gooey/issues/463
pull/473/head
Thorsten Wagner 5 years ago
committed by Chris
parent
commit
e74b884382
1 changed files with 3 additions and 2 deletions
  1. 5
      gooey/gui/components/util/wrapped_static_text.py

5
gooey/gui/components/util/wrapped_static_text.py

@ -33,6 +33,7 @@ class AutoWrappedStaticText(wx.StaticText):
super(AutoWrappedStaticText, self).__init__(parent, *args, **kwargs)
self.label = kwargs.get('label')
self.Bind(wx.EVT_SIZE, self.OnSize)
self.parent = parent
def OnSize(self, event):
@ -46,7 +47,7 @@ class AutoWrappedStaticText(wx.StaticText):
if self.target:
self.Wrap(self.target.GetSize().width)
else:
self.Wrap(event.GetSize().width)
self.Wrap(self.parent.GetSize()[0])
def Wrap(self, width):
"""
@ -93,4 +94,4 @@ class AutoWrappedStaticText(wx.StaticText):
if not wrapped:
self.label = label
wx.StaticText.SetLabel(self, label)
wx.StaticText.SetLabel(self, label)
Loading…
Cancel
Save