diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 23c3dfe5a1..c27fefd0d6 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,5 +1,4 @@ - fix compiled gc check -- 3 >n fep - code walker & exceptions -- test and debug problems - code walker and callbacks is broken? - prettyprinter's highlighting of non-leaves looks bad @@ -49,10 +48,8 @@ - x11 input methods - x11 title bars are funny - cocoa: - - need to flush callbacks - - don't multiplex in the event loop if there is no pending i/o - horizontal scrolling - - zooming doesn't work + - window zooming doesn't work - implement handlers for open, quit events, and whatever else - polish OS X menu bar code - when scrolling wheel, or moving mouse out of window, rollover is not diff --git a/library/cocoa/callback.factor b/library/cocoa/callback.factor index 8bf793544d..009c4d001e 100644 --- a/library/cocoa/callback.factor +++ b/library/cocoa/callback.factor @@ -6,7 +6,10 @@ USING: hashtables kernel namespaces objc objc-NSObject ; SYMBOL: callbacks -H{ } clone callbacks set-global +: reset-callbacks ( -- ) + H{ } clone callbacks set-global ; + +reset-callbacks "NSObject" "FactorCallback" { { "perform:" "void" { "id" "SEL" "id" } diff --git a/library/cocoa/ui.factor b/library/cocoa/ui.factor index 94e5b10c7e..6671b165df 100644 --- a/library/cocoa/ui.factor +++ b/library/cocoa/ui.factor @@ -18,12 +18,9 @@ IN: gadgets-cocoa ! Hash mapping aliens to gadgets SYMBOL: views -H{ } clone views set-global +: reset-views ( hash -- hash ) H{ } clone views set-global ; -: purge-views ( hash -- hash ) - global [ - views [ [ drop expired? not ] hash-subset ] change - ] bind ; +reset-views : view ( handle -- world ) views get hash ; @@ -237,8 +234,9 @@ IN: shells ] unless [ [ + reset-views + reset-callbacks init-ui - purge-views default-main-menu listener-window finish-launching