@@ -11,33 +11,42 @@ class Splash(widget.PrimaryFrame):
1111 questions = json .load (fp )
1212
1313 def init (self ):
14- self .intro = Intro (self )
15- self .intro .pack (fill = 'both' , expand = True )
14+ self .intro = Intro (self , bg = 'gray' )
1615
17- self .btn_confirm = widget .PrimaryButton (self .intro .window , command = self .next , text = 'Okay' )
16+ self .btn_confirm = widget .PrimaryButton (
17+ self .intro .window , command = self .switch , text = 'Okay'
18+ )
19+ self .update ()
1820
1921 def build (self ):
22+ self .update ()
23+ self .intro .pack (fill = 'both' , expand = True )
2024 self .intro .build ()
21- bouncer = View (self .intro .window , window = self .btn_confirm )
22- self .bounce (bouncer )
25+ self .bounce (
26+ View (self .intro .window , window = self .btn_confirm )
27+ )
2328
2429 def bounce (self , view ):
30+ self .update ()
2531 start = view .master .center + (Direction .LEFT * 175 ) + (Direction .DOWN * 100 )
2632 wid = view .master .set_view (view , start )
2733 motion = BounceBall (view .master , wid , view .master .origin , speed = 6 )
2834 motion .kick (Direction .UP )
2935 self .after (0 , view .master .run , motion )
3036
31- def next (self ):
37+ def switch (self ):
3238 self .master .master .switch ()
3339
40+ def cleanup (self ):
41+ self .intro .cleanup ()
42+
3443
3544class Intro (widget .PrimaryFrame ):
3645 intro = (DOCS / 'intro.txt' ).read_text ()
3746
3847 def init (self ):
39- self .window = Window (self , bg = 'gray' )
40- self .window .pack (fill = 'both' , expand = True )
48+ self .window = Window (self )
49+ self .window .pack (expand = True , fill = 'both' )
4150 self .update ()
4251
4352 width = self .winfo_reqwidth ()
@@ -53,15 +62,17 @@ def init(self):
5362 width = width ,
5463 font = ('sys' , 12 ), justify = 'center'
5564 )
56- self .update ()
5765
5866 def build (self ):
59- self .window . set_view ( self . title )
67+ self .update ( )
6068 adjust = (Direction .LEFT * 175 ) + (Direction .DOWN * 100 )
61- self .window .set_view (
62- self .intro ,
63- self .window .center + adjust
64- )
69+
70+ self .window .set_view (self .title )
71+ self .window .set_view (self .intro , self .window .center + adjust )
72+ self .update ()
73+
74+ def cleanup (self ):
75+ self .window .animater .clear ()
6576
6677
6778class Question (widget .PrimaryFrame ):
0 commit comments