Ideas for preference backend

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Ideas for preference backend

Mathieu Suen-2
Hi,

Gwen and I are building a preference system for gst.
There is a couple of idea we've wanted to propose you.

1)First question is wether to use a XML, ini .. file or a file containing plain
smalltalk code.

2) If we chose to have a smalltlalk file acting like a ".emacs"  what kind of
"dsl" do you want to see
Proposition 1: a verbose but simple one
PrefConfiguration from: {
        PrefGroup name: 'GTK' with: {
        PrefSection name: 'font' with: {
            PrefValue name: 'size' value: 12.
            PrefValue name: 'style' value: 'italic'
        }.            
        PrefSection name: 'color' with: {
            PrefSection name: 'windows'  with: {
                PrefColorValue name: 'background' value: 'EDE9E3'.
            }
        }
     }
}

Proposition 2: Less but more customizable one:
PrefConfiguration from: {
      'GTK' -> {
           'font' -> {
                'size' -> 12.
                'style' -> 'italic'
        }.            
        'color' -> {
            'windows'  -> {
                'background' -> 'EDE9E3'.
            }
        }
        }
}

Or other idea.

Thanks for your comment or remark.


Mth





_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Ideas for preference backend

Paolo Bonzini-2
On Fri, Nov 5, 2010 at 10:47, Mathieu Suen <[hidden email]> wrote:
> 1)First question is wether to use a XML, ini .. file or a file containing plain
> smalltalk code.

Either ini or smalltalk.  In the latter case there is already "~/.st/init.st".

Paolo

> Proposition 2: Less but more customizable one:
> PrefConfiguration from: {
>      'GTK' -> {
>           'font' -> {
>                'size' -> 12.
>                'style' -> 'italic'
>        }.
>        'color' -> {
>            'windows'  -> {
>                'background' -> 'EDE9E3'.
>            }
>        }
>        }
> }

Two levels only please:

(Smalltalk preferences at: #windows)
    at: #background put: 'EDE9E3'.

or you can even force the first level to be a package.

(PackageLoader packageAt: 'GTK') preferences
    at: #'window-background' put: 'EDE9E3';
    at: #'font-size' put: 12.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Ideas for preference backend

Nicolas Petton
Le vendredi 05 novembre 2010 à 13:13 +0100, Paolo Bonzini a écrit :
> On Fri, Nov 5, 2010 at 10:47, Mathieu Suen <[hidden email]> wrote:
> > 1)First question is wether to use a XML, ini .. file or a file containing plain
> > smalltalk code.
>
> Either ini or smalltalk.  In the latter case there is already "~/.st/init.st".

When is this file used?

Nico


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Ideas for preference backend

Paolo Bonzini-2
On 11/05/2010 02:45 PM, Nicolas Petton wrote:
> Le vendredi 05 novembre 2010 à 13:13 +0100, Paolo Bonzini a écrit :
>> On Fri, Nov 5, 2010 at 10:47, Mathieu Suen<[hidden email]>  wrote:
>>> 1)First question is wether to use a XML, ini .. file or a file containing plain
>>> smalltalk code.
>>
>> Either ini or smalltalk.  In the latter case there is already "~/.st/init.st".
>
> When is this file used?

Every time the interpreter is started.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk