Merge pull request #1522 from wxWidgets/fix-issue1508

Initialize __oldvalue
This commit is contained in:
Robin Dunn
2020-02-19 12:06:59 -08:00
committed by GitHub

View File

@@ -473,6 +473,7 @@ class IntCtrl(wx.TextCtrl):
self.__allow_long = 0
else:
self.__allow_long = 1
self.__oldvalue = None
if validator == wx.DefaultValidator:
validator = IntValidator()
@@ -506,7 +507,7 @@ class IntCtrl(wx.TextCtrl):
before passing the events on.
"""
value = self.GetValue()
if value != self.__oldvalue:
if self.__oldvalue is None or value != self.__oldvalue:
try:
self.GetEventHandler().ProcessEvent(
IntUpdatedEvent( self.GetId(), self.GetValue(), self ) )