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.
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 -- )

View File

@ -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