Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.stock
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk.opengl
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.opengl
gb.gui.qt
gb.gui.qt.ext
gb.gui.qt.opengl
gb.gui.qt.webkit
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.jit
gb.libxml
gb.logging
gb.map
gb.markdown
gb.media
gb.media.form
gb.memcached
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webkit
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.scanner
gb.sdl
gb.sdl.sound
gb.sdl2
gb.sdl2.audio
gb.settings
_Settings_Keys
Settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

gb.settings

This component allows your project to deal with application configuration files.

Author BenoƮt Minisini.

Class Description
Settings This class manages global configuration files.

Configuration Files

These files, typically called "xyzzy.conf" (where "xyzzy" is the name of your application), can be interrogated to obtain locally specific settings and can be used to store such settings between invocations of the application.

Configuration File Syntax

Warning:

The information below can be useful but the Settings file syntax is considered "internal" and is subject to change without notice at any time so the information is unreliable.
It is recommended to NOT access the configuration files directly in your application as the format may change. Use the Settings.class instead.

A configuration file is a text file, in which each line is:
  • A void line, that is ignored.

  • A comment line, beginning with a '#' or a ';' character, that is ignored.

  • A value line, which is a "Key=Value" pair.

  • A slot line, which begins with a '[' character, and ends with a ']' character. This groups key/value lines together in a slot.

A value is accessed from its full key, which is the slot name followed by a slash and the key.

A slot name can contain slashes too.

Examples

[Editor]
Font="Bitstream Vera Sans Mono"
Toolbar=1
CleanOnSave=0
ShowProc=1
ShowChange=1
ShowCurrent=1
UseRelief=1
Color[0]="&FFFFFF&"
Color[1]="&000000&"
Color[2]="&00C0A0&"
Color[3]="&00C000&"

[ExistingFile]
ExplorerType=0
Splitter="249,249"
TreeSequence="0"
PreviewImg=0
ShowHidden=0

[ExistingImage]
Path="/usr/share/icons/crystalsvg/64x64/devices"
Key="1"
ExplorerType=1
Splitter="212,434"
TreeSequence="1"
PreviewImg=1
ShowHidden=0

[...]