<s> '''<STR_LIT>''' <EOL> import wx <EOL> from python_toolbox . freezing import Freezer <EOL> class WindowFreezer ( Freezer ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , window ) : <EOL> Freezer . __init__ ( self ) <EOL> assert isinstance ( window , wx . Window ) <EOL> self . window = window <EOL> def freeze_handler ( self ) : <EOL> self . window . Freeze ( ) <EOL> def thaw_handler ( self ) : <EOL> self . window . Thaw ( ) <EOL> class FlagRaiser : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , window , attribute_name = None , function = None , delay = None ) : <EOL> '''<STR_LIT>''' <EOL> assert isinstance ( window , wx . Window ) <EOL> self . window = window <EOL> '''<STR_LIT>''' <EOL> self . attribute_name = attribute_name <EOL> '''<STR_LIT>''' <EOL> self . function = function or window . Refresh <EOL> '''<STR_LIT>''' <EOL> self . delay = delay <EOL> '''<STR_LIT>''' <EOL> if delay is not None : <EOL> self . _delay_in_ms = delay * <NUM_LIT:1000> <EOL> '''<STR_LIT>''' <EOL> self . timer = cute_timer . CuteTimer ( self . window ) <EOL> '''<STR_LIT>''' <EOL> self . window . Bind ( wx . EVT_TIMER , self . _on_timer , self . timer ) <EOL> def __call__ ( self ) : <EOL> '''<STR_LIT>''' <EOL> if self . attribute_name : <EOL> setattr ( self . window , self . attribute_name , True ) <EOL> if self . delay is None : <EOL> self . function ( ) <EOL> else : <EOL> if not self . timer . IsRunning ( ) : <EOL> self . timer . Start ( self . _delay_in_ms , oneShot = True ) <EOL> def _on_timer ( self , event ) : <EOL> if getattr ( self . window , self . attribute_name ) is True : <EOL> self . function ( ) </s>
