]> gitweb.factorcode.org Git - factor.git/commitdiff
update status-bar for api changes. set the gl-context outside of draw-world* generic
authorJoe Groff <arcata@gmail.com>
Sun, 3 May 2009 22:11:01 +0000 (17:11 -0500)
committerJoe Groff <arcata@gmail.com>
Sun, 3 May 2009 22:11:01 +0000 (17:11 -0500)
basis/ui/gadgets/status-bar/status-bar.factor
basis/ui/gadgets/worlds/worlds.factor

index a1c2dca23d04e3b91844f1a6f68efe09ad7323de..0d3015508e34b7945151d6d70eaea02d29488651 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors models models.delay models.arrow
 sequences ui.gadgets.labels ui.gadgets.tracks
-ui.gadgets.worlds ui.gadgets ui kernel calendar summary ;
+ui.gadgets.worlds ui.gadgets ui ui.private kernel calendar summary ;
 IN: ui.gadgets.status-bar
 
 : <status-bar> ( model -- gadget )
@@ -10,9 +10,9 @@ IN: ui.gadgets.status-bar
     reverse-video-theme
     t >>root? ;
 
-: open-status-window ( gadget title -- )
-    f <model> [ <world> ] keep
-    <status-bar> f track-add
+: open-status-window ( gadget title/attributes -- )
+    ?attributes f <model> >>status <world>
+    dup status>> <status-bar> f track-add
     open-world-window ;
 
 : show-summary ( object gadget -- )
index 68ef6a4b9ac51d31f1dcf4d2f6d6e8695d6ccbb5..837cf822dc2f6c3fed9c544145b98259bf586928 100755 (executable)
@@ -105,16 +105,13 @@ M: world end-world
 GENERIC: draw-world* ( world -- )
 
 M: world draw-world*
-    dup handle>> [
-        check-extensions
-        {
-            [ init-gl ]
-            [ draw-gadget ]
-            [ text-handle>> [ purge-cache ] when* ]
-            [ images>> [ purge-cache ] when* ]
-        } cleave
-    ] with-gl-context
-    flush-layout-cache-hook get call( -- ) ;
+    check-extensions
+    {
+        [ init-gl ]
+        [ draw-gadget ]
+        [ text-handle>> [ purge-cache ] when* ]
+        [ images>> [ purge-cache ] when* ]
+    } cleave ;
 
 : draw-world? ( world -- ? )
     #! We don't draw deactivated worlds, or those with 0 size.
@@ -135,7 +132,10 @@ ui-error-hook [ [ rethrow ] ] initialize
 : draw-world ( world -- )
     dup draw-world? [
         dup world [
-            [ draw-world* ] [
+            [
+                dup handle>> [ draw-world* ] with-gl-context
+                flush-layout-cache-hook get call( -- )
+            ] [
                 over <world-error> ui-error
                 f >>active? drop
             ] recover