update status-bar for api changes. set the gl-context outside of draw-world* generic
parent
6ccd82faba
commit
474735a60c
|
@ -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 -- )
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue