update status-bar for api changes. set the gl-context outside of draw-world* generic

db4
Joe Groff 2009-05-03 17:11:01 -05:00
parent 6ccd82faba
commit 474735a60c
2 changed files with 15 additions and 15 deletions

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors models models.delay models.arrow USING: accessors models models.delay models.arrow
sequences ui.gadgets.labels ui.gadgets.tracks 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 IN: ui.gadgets.status-bar
: <status-bar> ( model -- gadget ) : <status-bar> ( model -- gadget )
@ -10,9 +10,9 @@ IN: ui.gadgets.status-bar
reverse-video-theme reverse-video-theme
t >>root? ; t >>root? ;
: open-status-window ( gadget title -- ) : open-status-window ( gadget title/attributes -- )
f <model> [ <world> ] keep ?attributes f <model> >>status <world>
<status-bar> f track-add dup status>> <status-bar> f track-add
open-world-window ; open-world-window ;
: show-summary ( object gadget -- ) : show-summary ( object gadget -- )

View File

@ -105,16 +105,13 @@ M: world end-world
GENERIC: draw-world* ( world -- ) GENERIC: draw-world* ( world -- )
M: world draw-world* M: world draw-world*
dup handle>> [ check-extensions
check-extensions {
{ [ init-gl ]
[ init-gl ] [ draw-gadget ]
[ draw-gadget ] [ text-handle>> [ purge-cache ] when* ]
[ text-handle>> [ purge-cache ] when* ] [ images>> [ purge-cache ] when* ]
[ images>> [ purge-cache ] when* ] } cleave ;
} cleave
] with-gl-context
flush-layout-cache-hook get call( -- ) ;
: draw-world? ( world -- ? ) : draw-world? ( world -- ? )
#! We don't draw deactivated worlds, or those with 0 size. #! We don't draw deactivated worlds, or those with 0 size.
@ -135,7 +132,10 @@ ui-error-hook [ [ rethrow ] ] initialize
: draw-world ( world -- ) : draw-world ( world -- )
dup draw-world? [ dup draw-world? [
dup world [ dup world [
[ draw-world* ] [ [
dup handle>> [ draw-world* ] with-gl-context
flush-layout-cache-hook get call( -- )
] [
over <world-error> ui-error over <world-error> ui-error
f >>active? drop f >>active? drop
] recover ] recover