[squeak-dev] Re: Preferences with spaces in them

Ronald Spengler ron.spengler at gmail.com
Sun Aug 23 05:37:31 UTC 2009


Interesting. While digging around trying to find out what was going on, I
did stumble across PragmaPreference by printing:
Preferences allPreferenceObjects
... and searching the resultant text for 'Editors' finding "a
PragmaPreference#'Use New Editors' nil#'Use New Editors'" in the output.

But the class comment for PragmaPreference:

"Differs from superclass by redirecting all queries to preference provider."

... didn't help me any, because I didn't know what was meant by preference
provider. For want of Cmd-Shift-E (thank you! awesome!) I just browsed the
protocol a bit, looked at the superclass, gave up and cried 'halp!'

Maybe I would have grokked this right away had I a better (read: passing)
grasp of the superclass, but PragmaPreference feels like it wants to do
something of architectural significance. Maybe move preferences off to the
actual objects where the behavior is specified, instead of a big pile,
perhaps?

 - Ron, curiously

On Sat, Aug 22, 2009 at 9:50 PM, Andreas Raab <andreas.raab at gmx.de> wrote:

> Ronald Spengler wrote:
>
>> How can I talk to preferences that have spaces in them? I'm trying to add
>> a line to my image configuration script that enables the Cuis editors
>> automatically.
>>
>
> Cmd-Shift-E (Alt-Shift-E) is your friend. Select "Use New Editors", press
> Cmd-Shift-E and the only hit should be TextMorph class>>useNewEditors with
> its companion accessor #useNewEditors:.
>
> (what you are seeing here is a pragma preference which shouldn't be
> manipulated by its user-visible description)
>
> Cheers,
>  - Andreas
>
>
>> My usual strategy of:
>>
>> Preferences
>> setPreference: #swapMouseButtons toValue: true
>>
>> ... doesn't seem to work.
>>
>> When I print:
>>
>> Preferences setPreference: #'Use New Editors' toValue: true;
>> valueOfPreference: #'Use New Editors'
>>
>> ... I get back nil.
>>
>> Failing that, I also tried:
>>
>> Preferences togglePreference: #'Use New Editors'
>>
>> ... which pops a MNU, so in general I think there's something that I'm
>> failing to understand.
>>
>> Any help is much appreciated.
>>
>>  - Ron
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090822/44b89173/attachment.htm


More information about the Squeak-dev mailing list