Skip to main content
Engineering LibreTexts

4.2: The Settings Browser

  • Page ID
    43807
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The Settings Browser, shown in Figure \(\PageIndex{1}\), mainly allows one to browse all currently declared settings and to change related preference values.

    To open the Settings Browser, just use the World menu (World ⊳ System ⊳ Settings) or evaluate the following expression:

    SettingBrowser open
    

    The settings are presented in several trees in the middle panel. Setting searching and filtering is available from the top tool-bar whereas the bottom panels show currently selected setting descriptions (left bottom panel) and current package set (right bottom panel).

    The Settings Browser.
    Figure \(\PageIndex{1}\): The Settings Browser.

    Browsing and changing preference values

    Setting declarations are organized in trees which can be browsed in the middle panel. To get a description for a setting, just click on it: the setting is selected and the left bottom panel is updated with information about the selected setting.

    Changing a preference value is simply done through the browser: each line holds a widget on the right with which you can update the value. The kind of widget depends on the actual type of the preference value. Whereas a preference value can be of any kind, the setting browser is currently able to present a specific input widget for the following types: Boolean, Color, FileName, DirectoryName, Font, Number, Point and String. A drop-list, a password field or a range input widget using a slider can also be used. Of course, the list of possible widgets is not closed as it is possible to make the setting browser support new kinds of preference values or use different input widgets. This point is explained in Section 5.8.

    If the actual type of a setting is either String, FileName, DirectoryName, Number or Point, to change a value, the user has to enter some text in an editable drop-list widget. In such a case, the input must be confirmed by hitting the return key (or with cmd-s). If such a setting value is changed often, the drop-list widget comes in handy because you can retrieve and use previously entered values in one click! Moreover, in case of a FileName or a DirectoryName, a button is added to open a file name or a directory name chooser dialog.

    Other possible actions are all accessible from the contextual menu. Depending on the selected setting, they may be different. The two possible versions are shown in Figure \(\PageIndex{2}\).

    The contextual popup menu.
    Figure \(\PageIndex{2}\): The contextual popup menu.
    • Expand all (a): expand all the setting tree nodes recursively. It is also accessible via the keyboard shortcut cmd-a.

    • Collapse all (a): collapse all the setting tree nodes recursively. It is also accessible via the keyboard shortcut cmd-A.

    • Expand all from here: Expand the currently selected setting tree node recursively.

    • Browse (b): open a system browser on the method that declares the setting. It is also accessible via the keyboard shortcut cmd-b or if you double-click on a setting. It is very handy if you want to change the setting implementation or simply see how it is implemented to understand the framework by investigating some examples (how to declare a setting is explained in Section 5.3).

    • Display export action string: a setting can be exported as a start-up action, this menu option allow to display how the start-up action is coded (Start-up action management is explained in Section 5.7).

    • Set to default (d): set the selected setting value to the default one. It is useful if, as an example, you have played with a setting to observe its effect and finally decide to come back to its default.

    • Empty list (e): If the input widget is an editable drop-list, this menu item allows one to forget previously entered values by emptying the recorded list.

    Searching and filtering settings

    Pharo contains a lot of settings and finding one of them can be tedious. You can filter the settings list by entering something in the search text field of the top bar of the SettingsBrowser. Then, only the settings whose name or description contains the text you have entered will be shown. The text can be a regular expression if the "Regexp" checkbox is checked.

    Another way to filter the list of settings is to choose them by package. Just click on the "Choose package" button, then a dialog is opened with the list of packages in which some settings are declared. If you choose one or several of them, only settings which are declared in the selected packages are shown. Notice that the bottom right text pane is updated with the name of the selected packages.

    Depending on where and when you are using Pharo, you may have to change preferences repeately. As an example, when you are doing a demontration, you may want to have bigger fonts, at work you may need to set a proxy whereas at home none is needed. Having to change a set of preferences depending on where you are and what you are doing can be very tedious and boring. With the Settings Browser, it is possible to save the current set of preference values in a named style that can be reloaded later.


    This page titled 4.2: The Settings Browser is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Alexandre Bergel, Damien Cassou, Stéphane Ducasse, Jannik Laval (Square Bracket Associates) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.