Skip to content

Commit

Permalink
fixes #103
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroautalan committed Mar 26, 2017
1 parent 139cc74 commit b0bfd61
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pygubudesigner/widgets/whentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ def _set_value(self, value):
else:
self._weditor.edit('')
self._heditor.edit('')

def _validate(self):
isvalid = False
if self._weditor.value != '' and self._heditor.value != '':
w = self._weditor.value
h = self._heditor.value
if w == '' and h == '':
isvalid = True
else:
try:
if int(w) >= 0 and int(h) >= 0:
isvalid = True
except ValueError:
pass
return isvalid

register_editor('whentry', WHPropertyEditor)

0 comments on commit b0bfd61

Please sign in to comment.