Programmatically changing settings values

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

Programmatically changing settings values

Torsten Bergmann
Pablo wrote
>> I would like to change some of the environment settings by code

Markus wrote:
>The gobal compiler can be changed by  SmalltalkImage compilerClass: Compiler


There is an easy way how to find this out by yourself:

  - open World Menu >> System >> Settings and navigate to the setting
  - right click on a setting and choose "Browse"

=> this will open the Smalltalk browser on the method that defines
   the settings for the settings builder. In your case it should
   open AbstractCompiler(class)>>compilerSettingsOn: where the
   <systemsettings> pragma gives a hint to be used as a settings builder method.

   Here you will see that the target of the first setting definition
   is "SmalltalkImage" and the selector is #compilerClass. So you can use

      SmalltalkImage compilerClass             to return the setting and
      SmalltalkImage compilerClass: MyCompiler to set it.

See [1] for more (may be outdated) or better read the recent Pharo books, one
includes a chapter on the settings framework.

http://www.pharobyexample.org/
http://www.deepintopharo.com/
https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccessfulBuild/artifact/

Bye
T.

[1] http://pharo.gemtalksystems.com/book/Tidbits/CustomizingPharo/DeclaringSetting/