#NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# grid = Grid ( 4 , 3 , CellPadding = 50 , CellSpacing = 0 ) #NEWLINE# rf = grid . getRowFormatter ( ) #NEWLINE# rf . setStyleName ( 1 , 'oddrow' ) #NEWLINE# rf . setStyleName ( 3 , 'oddrow' ) #NEWLINE# clock = Clock ( ) #NEWLINE# grid . setWidget ( 0 , 0 , CaptionPanel ( 'Using notify()' , clock . button , StyleName = 'left' ) ) #NEWLINE# grid . setWidget ( 0 , 1 , clock . datelabel ) #NEWLINE# grid . setWidget ( 0 , 2 , HTML ( Clock . __doc__ , StyleName = 'desc' ) ) #NEWLINE# ptb = PopupTimerButton ( 5 ) #NEWLINE# grid . setWidget ( 1 , 0 , CaptionPanel ( 'Subclassing Timer()' , ptb , StyleName = 'left' ) ) #NEWLINE# grid . setWidget ( 1 , 1 , ptb . box ) #NEWLINE# grid . setWidget ( 1 , 2 , HTML ( PopupTimerButton . __doc__ , StyleName = 'desc' ) ) #NEWLINE# ptb = PopupTimerButton ( 15 ) #NEWLINE# grid . setWidget ( 2 , 0 , CaptionPanel ( 'Subclassing Timer()&nbsp;&nbsp;(<em>again</em>)' , ptb , StyleName = 'left' ) ) #NEWLINE# grid . setWidget ( 2 , 1 , ptb . box ) #NEWLINE# grid . setWidget ( 2 , 2 , HTML ( 'This is the same as the previous\n                                  example and is here to demonstrate\n                                  creating multiple timers (each with\n                                  their own state) which is difficult\n                                  to do without sublcassing' , StyleName = 'desc' ) ) #NEWLINE# randomcolor = RandomColor ( ) #NEWLINE# grid . setWidget ( 3 , 0 , CaptionPanel ( 'Using onTimer()' , randomcolor . hpanel , StyleName = 'left' ) ) #NEWLINE# grid . setWidget ( 3 , 1 , randomcolor . colorpanel ) #NEWLINE# grid . setWidget ( 3 , 2 , HTML ( RandomColor . __doc__ , StyleName = 'desc' ) ) #NEWLINE# RootPanel ( ) . add ( grid ) #NEWLINE# randomcolor . initialize ( )