diff --git a/collects/framework/framework.ss b/collects/framework/framework.ss index dec0511a..b48e408d 100644 --- a/collects/framework/framework.ss +++ b/collects/framework/framework.ss @@ -1569,8 +1569,13 @@ "changes the foreground color to \\var{color}." "Then, it calls " "@flink editor:set-standard-style-list-delta" - "passing the \\var{style-name} and the newly" - "created \\iscmclass{style-delta}.") + "passing the \\var{style-name} and the current value" + "of the preference \\var{pref-name}." + "" + "Finally, it adds calls" + "@flink preferences:add-callback " + "to set a callback for \\var{pref-name} that" + "updates the style list when the preference changes.") (color-prefs:add-preferences-panel (-> void?) diff --git a/collects/framework/private/color-prefs.ss b/collects/framework/private/color-prefs.ss index 55b1f760..d13db3c5 100644 --- a/collects/framework/private/color-prefs.ss +++ b/collects/framework/private/color-prefs.ss @@ -103,12 +103,6 @@ (send c set-line-count 1) (send c allow-tab-exit #t) - (preferences:add-callback pref-sym - (lambda (sym v) - (editor:set-standard-style-list-delta style-name v) - #t)) - (editor:set-standard-style-list-delta style-name delta) - (send e insert example-text) (send e set-position 0) @@ -282,7 +276,10 @@ (define (register-color-pref pref-name style-name color) (let ([sd (new style-delta%)]) (send sd set-delta-foreground color) - (preferences:set-default pref-name sd (lambda (x) (is-a? x style-delta%))) - (preferences:set-un/marshall pref-name marshall-style unmarshall-style) - (editor:set-standard-style-list-delta style-name sd)))))) + (preferences:set-default pref-name sd (lambda (x) (is-a? x style-delta%)))) + (preferences:set-un/marshall pref-name marshall-style unmarshall-style) + (preferences:add-callback pref-name + (lambda (sym v) + (editor:set-standard-style-list-delta style-name v))) + (editor:set-standard-style-list-delta style-name (preferences:get pref-name))))))