----- Original Message ----- 
From: "Norbert Hartl" <[email protected]>
To: <[email protected]>; <[email protected]>
Sent: Friday, March 06, 2009 11:22 AM
Subject: Re: [Pharo-project] [Fwd: Re: [ANN] Preference pragmas]


> On Fri, 2009-03-06 at 12:02 +0100, Alain Plantec wrote:
>> Matthew Fulmer a écrit :
>> > On Fri, Mar 06, 2009 at 10:36:13AM +0100, Alain Plantec wrote:
>> >
>> >> themePreference
>> >>     <preference>
>> >>     ^ ThemePreference
>> >>         ifNil: [ThemePreference := MultiplePreferenceValue
>> >>                         name: 'UITheme'
>> >>                         description: 'The theme to use for UI look and 
>> >> feel'
>> >>                         parent: #uiPreferenceNode
>> >>                         type: #UITheme
>> >>                         default: UIThemeWatery2
>> >>                         values: {
>> >>                             FixedPreferenceValue
>> >>                                 name: 'Standard Squeak'
>> >>                                 description: 'Standard Squeak style'
>> >>                                 type: #UITheme
>> >>
>> >>                                 value: UIThemeStandardSqueak.
>> >>                             FixedPreferenceValue
>> >>                                 name: 'Watery 2'
>> >>                                 description: 'Similar to a nice OS'
>> >>                                 type: #UITheme
>> >>                                 value: UIThemeWatery2}]
>> >>
>> >
>> >
>> Hi Matthew,
>> > You're really just inventing a half-baked Magritte now.
>> Surely, but, for now, Magritte is not in the base system.
>> Maybe you can send some advices or ideas about how we can improve
>> the preference system.
>>
>> And the <preference:ziag:zig:> way is still a solution we can adopt back
>> if the pharo community prefers it.
>>
>> > Do
>> > yourself a favor and use the real thing. Magritte is far more
>> > descriptive and far less verbose than anything you have yet
>> > presented. Magritte also already knows how to automatically create both
>> > seaside and morphic forms out of a field description. It also
>> > knows more ways to look up a field than just selector and block.
>> >
>> Anyway, it seems very interesting and I would like to learn a bit about
>> Magritte even it is not possible to use it for preferences.
>> As an example, could you explain how you specify the themePreference
>> with Magritte ?
>> Maybe it can help us to improve our implementation.
>> Thanks
>> alain
>>
> I'm not sure but I'm starting to understand what Matthew wanted.
> I think the description would like this
>
> descriptionThemePreference
>   ^ MASingleOptionDescription new
>      selectorAccessor: #themePreference;
>      label: 'The theme to use for UI look and feel';
>      reference: MAClassDescription new;
>      options: {UIThemeStandardSqueak. UIThemeWatery2};
>      default: UIThemeWatery2;
>      priority: 1000;
>      yourself
>
> Hmmm, I'm not sure if I should revoke my former mail :)
>
> Norbert
>

Or even:

descriptionThemePreference

^MASingleOptionDescription new
     selectorAccessor: #themePreference;
     label: 'UI Theme';
     comment: 'The theme to use for UI look and feel';
     reference: MAClassDescription new;
     optionsAndLabels: {UIThemeStandardSqueak->'Standard Squeak' . 
UIThemeWatery2->'Watery 2'};
     default: UIThemeWatery2;
     priority: 1000;
     beRequired;
     yourself

Although the "labels" for options doesn't work in Magritte yet... plus no 
description for each selectable theme. Also, to look nicer would benefit 
from adding more to Magritte for radio button lists which would then require 
setting the widget/morph/seaside-thing class explicitly for each rendering 
target.

Using this scheme the change-of-preference notification handling would need 
to be implemented for each defined preference also... more and more 
complicated and increased replication of code.

Regards Gary


_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to