|  |  |  | GTK+ Reference Manual |  | 
|---|
| SettingsSettings — Sharing settings between applications | 
#include <gtk/gtk.h>
            GtkSettings;
            GtkSettingsValue;
GtkSettings* gtk_settings_get_default       (void);
GtkSettings* gtk_settings_get_for_screen    (GdkScreen *screen);
void        gtk_settings_install_property   (GParamSpec *pspec);
void        gtk_settings_install_property_parser
                                            (GParamSpec *pspec,
                                             GtkRcPropertyParser parser);
gboolean    gtk_rc_property_parse_color     (const GParamSpec *pspec,
                                             const GString *gstring,
                                             GValue *property_value);
gboolean    gtk_rc_property_parse_enum      (const GParamSpec *pspec,
                                             const GString *gstring,
                                             GValue *property_value);
gboolean    gtk_rc_property_parse_flags     (const GParamSpec *pspec,
                                             const GString *gstring,
                                             GValue *property_value);
gboolean    gtk_rc_property_parse_requisition
                                            (const GParamSpec *pspec,
                                             const GString *gstring,
                                             GValue *property_value);
gboolean    gtk_rc_property_parse_border    (const GParamSpec *pspec,
                                             const GString *gstring,
                                             GValue *property_value);
void        gtk_settings_set_property_value (GtkSettings *settings,
                                             const gchar *name,
                                             const GtkSettingsValue *svalue);
void        gtk_settings_set_string_property
                                            (GtkSettings *settings,
                                             const gchar *name,
                                             const gchar *v_string,
                                             const gchar *origin);
void        gtk_settings_set_long_property  (GtkSettings *settings,
                                             const gchar *name,
                                             glong v_long,
                                             const gchar *origin);
void        gtk_settings_set_double_property
                                            (GtkSettings *settings,
                                             const gchar *name,
                                             gdouble v_double,
                                             const gchar *origin);
"gtk-alternative-button-order" gboolean : Read / Write "gtk-button-images" gboolean : Read / Write "gtk-can-change-accels" gboolean : Read / Write "gtk-color-palette" gchararray : Read / Write "gtk-cursor-blink" gboolean : Read / Write "gtk-cursor-blink-time" gint : Read / Write "gtk-cursor-theme-name" gchararray : Read / Write "gtk-cursor-theme-size" gint : Read / Write "gtk-dnd-drag-threshold" gint : Read / Write "gtk-double-click-distance" gint : Read / Write "gtk-double-click-time" gint : Read / Write "gtk-entry-select-on-focus" gboolean : Read / Write "gtk-font-name" gchararray : Read / Write "gtk-icon-sizes" gchararray : Read / Write "gtk-icon-theme-name" gchararray : Read / Write "gtk-key-theme-name" gchararray : Read / Write "gtk-menu-bar-accel" gchararray : Read / Write "gtk-menu-bar-popup-delay" gint : Read / Write "gtk-menu-images" gboolean : Read / Write "gtk-menu-popdown-delay" gint : Read / Write "gtk-menu-popup-delay" gint : Read / Write "gtk-modules" gchararray : Read / Write "gtk-split-cursor" gboolean : Read / Write "gtk-theme-name" gchararray : Read / Write "gtk-toolbar-icon-size" GtkIconSize : Read / Write "gtk-toolbar-style" GtkToolbarStyle : Read / Write "gtk-xft-antialias" gint : Read / Write "gtk-xft-dpi" gint : Read / Write "gtk-xft-hinting" gint : Read / Write "gtk-xft-hintstyle" gchararray : Read / Write "gtk-xft-rgba" gchararray : Read / Write
typedef struct {
  /* origin should be something like "filename:linenumber" for rc files,
   * or e.g. "XProperty" for other sources
   */
  gchar *origin;
  /* valid types are LONG, DOUBLE and STRING corresponding to the token parsed,
   * or a GSTRING holding an unparsed statement
   */
  GValue value;
} GtkSettingsValue;
GtkSettings* gtk_settings_get_default (void);
Gets the GtkSettings object for the default GDK screen, creating
it if necessary. See gtk_settings_get_for_screen().
| Returns : | a GtkSettings object. If there is no default
 screen, then returns NULL. | 
GtkSettings* gtk_settings_get_for_screen (GdkScreen *screen);
Gets the GtkSettings object for screen, creating it if necessary.
| screen: | a GdkScreen. | 
| Returns : | a GtkSettings object. | 
Since 2.2
void        gtk_settings_install_property_parser
                                            (GParamSpec *pspec,
                                             GtkRcPropertyParser parser);
| pspec: | |
| parser: | 
gboolean gtk_rc_property_parse_color (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a
color given either by its name or in the form 
{ red, green, blue } where red, green and
blue are integers between 0 and 65535 or floating-point numbers
between 0 and 1.
| pspec: | a GParamSpec | 
| gstring: | the GString to be parsed | 
| property_value: | a GValue which must hold GdkColor values. | 
| Returns : | TRUEifgstringcould be parsed andproperty_valuehas been set to the resulting GdkColor. | 
gboolean gtk_rc_property_parse_enum (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a single
enumeration value.
The enumeration value can be specified by its name, its nickname or its numeric value. For consistency with flags parsing, the value may be surrounded by parentheses.
| pspec: | a GParamSpec | 
| gstring: | the GString to be parsed | 
| property_value: | a GValue which must hold enum values. | 
| Returns : | TRUEifgstringcould be parsed andproperty_valuehas been set to the resulting GEnumValue. | 
gboolean gtk_rc_property_parse_flags (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses flags. 
Flags can be specified by their name, their nickname or
numerically. Multiple flags can be specified in the form 
"( flag1 | flag2 | ... )".
| pspec: | a GParamSpec | 
| gstring: | the GString to be parsed | 
| property_value: | a GValue which must hold flags values. | 
| Returns : | TRUEifgstringcould be parsed andproperty_valuehas been set to the resulting flags value. | 
gboolean gtk_rc_property_parse_requisition (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses a
requisition in the form 
"{ width, height }" for integers width and height.
| pspec: | a GParamSpec | 
| gstring: | the GString to be parsed | 
| property_value: | a GValue which must hold boxed values. | 
| Returns : | TRUEifgstringcould be parsed andproperty_valuehas been set to the resulting GtkRequisition. | 
gboolean gtk_rc_property_parse_border (const GParamSpec *pspec, const GString *gstring, GValue *property_value);
A GtkRcPropertyParser for use with gtk_settings_install_property_parser()
or gtk_widget_class_install_style_property_parser() which parses
borders in the form 
"{ left, right, top, bottom }" for integers 
left, right, top and bottom.
| pspec: | a GParamSpec | 
| gstring: | the GString to be parsed | 
| property_value: | a GValue which must hold boxed values. | 
| Returns : | TRUEifgstringcould be parsed andproperty_valuehas been set to the resulting GtkBorder. | 
void gtk_settings_set_property_value (GtkSettings *settings, const gchar *name, const GtkSettingsValue *svalue);
| settings: | |
| name: | |
| svalue: | 
void        gtk_settings_set_string_property
                                            (GtkSettings *settings,
                                             const gchar *name,
                                             const gchar *v_string,
                                             const gchar *origin);
| settings: | |
| name: | |
| v_string: | |
| origin: | 
void gtk_settings_set_long_property (GtkSettings *settings, const gchar *name, glong v_long, const gchar *origin);
| settings: | |
| name: | |
| v_long: | |
| origin: | 
void        gtk_settings_set_double_property
                                            (GtkSettings *settings,
                                             const gchar *name,
                                             gdouble v_double,
                                             const gchar *origin);
| settings: | |
| name: | |
| v_double: | |
| origin: | 
gtk-alternative-button-order" property"gtk-alternative-button-order" gboolean : Read / Write
Whether buttons in dialogs should use the alternative button order.
Default value: FALSE
gtk-button-images" property"gtk-button-images" gboolean : Read / Write
Whether stock icons should be shown in buttons.
Default value: TRUE
gtk-can-change-accels" property"gtk-can-change-accels" gboolean : Read / Write
Whether menu accelerators can be changed by pressing a key over the menu item.
Default value: FALSE
gtk-color-palette" property"gtk-color-palette" gchararray : Read / Write
Palette to use in the color selector.
Default value: "black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90"
gtk-cursor-blink" property"gtk-cursor-blink" gboolean : Read / Write
Whether the cursor should blink.
Default value: TRUE
gtk-cursor-blink-time" property"gtk-cursor-blink-time" gint : Read / Write
Length of the cursor blink cycle, in milleseconds.
Allowed values: >= 100
Default value: 1200
gtk-cursor-theme-name" property"gtk-cursor-theme-name" gchararray : Read / Write
Name of the cursor theme to use.
Default value: NULL
gtk-cursor-theme-size" property"gtk-cursor-theme-size" gint : Read / Write
Size to use for cursors.
Allowed values: [0,128]
Default value: 24
gtk-dnd-drag-threshold" property"gtk-dnd-drag-threshold" gint : Read / Write
Number of pixels the cursor can move before dragging.
Allowed values: >= 1
Default value: 8
gtk-double-click-distance" property"gtk-double-click-distance" gint : Read / Write
Maximum distance allowed between two clicks for them to be considered a double click (in pixels).
Allowed values: >= 0
Default value: 5
gtk-double-click-time" property"gtk-double-click-time" gint : Read / Write
Maximum time allowed between two clicks for them to be considered a double click (in milliseconds).
Allowed values: >= 0
Default value: 250
gtk-entry-select-on-focus" property"gtk-entry-select-on-focus" gboolean : Read / Write
Whether to select the contents of an entry when it is focused.
Default value: TRUE
gtk-font-name" property"gtk-font-name" gchararray : Read / Write
Name of default font to use.
Default value: "Sans 10"
gtk-icon-sizes" property"gtk-icon-sizes" gchararray : Read / Write
List of icon sizes (gtk-menu=16,16;gtk-button=20,20...
Default value: NULL
gtk-icon-theme-name" property"gtk-icon-theme-name" gchararray : Read / Write
Name of icon theme to use.
Default value: "hicolor"
gtk-key-theme-name" property"gtk-key-theme-name" gchararray : Read / Write
Name of key theme RC file to load.
Default value: NULL
gtk-menu-bar-accel" property"gtk-menu-bar-accel" gchararray : Read / Write
Keybinding to activate the menu bar.
Default value: "F10"
gtk-menu-bar-popup-delay" property"gtk-menu-bar-popup-delay" gint : Read / Write
Delay before the submenus of a menu bar appear.
Allowed values: >= 0
Default value: 0
gtk-menu-images" property"gtk-menu-images" gboolean : Read / Write
Whether images should be shown in menus.
Default value: TRUE
gtk-menu-popdown-delay" property"gtk-menu-popdown-delay" gint : Read / Write
The time before hiding a submenu when the pointer is moving towards the submenu.
Allowed values: >= 0
Default value: 1000
gtk-menu-popup-delay" property"gtk-menu-popup-delay" gint : Read / Write
Minimum time the pointer must stay over a menu item before the submenu appear.
Allowed values: >= 0
Default value: 225
gtk-modules" property"gtk-modules" gchararray : Read / Write
List of currently active GTK modules.
Default value: NULL
gtk-split-cursor" property"gtk-split-cursor" gboolean : Read / Write
Whether two cursors should be displayed for mixed left-to-right and right-to-left text.
Default value: TRUE
gtk-theme-name" property"gtk-theme-name" gchararray : Read / Write
Name of theme RC file to load.
Default value: "Default"
gtk-toolbar-icon-size" property"gtk-toolbar-icon-size" GtkIconSize : Read / Write
Size of icons in default toolbars.
Default value: GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style" property"gtk-toolbar-style" GtkToolbarStyle : Read / Write
Whether default toolbars have text only, text and icons, icons only, etc.
Default value: GTK_TOOLBAR_BOTH
gtk-xft-antialias" property"gtk-xft-antialias" gint : Read / Write
Whether to antialias Xft fonts; 0=no, 1=yes, -1=default.
Allowed values: [-1,1]
Default value: -1
gtk-xft-dpi" property"gtk-xft-dpi" gint : Read / Write
Resolution for Xft, in 1024 * dots/inch. -1 to use default value.
Allowed values: [-1,1048576]
Default value: -1
gtk-xft-hinting" property"gtk-xft-hinting" gint : Read / Write
Whether to hint Xft fonts; 0=no, 1=yes, -1=default.
Allowed values: [-1,1]
Default value: -1
gtk-xft-hintstyle" property"gtk-xft-hintstyle" gchararray : Read / Write
What degree of hinting to use; none, slight, medium, or full.
Default value: NULL
gtk-xft-rgba" property"gtk-xft-rgba" gchararray : Read / Write
Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr.
Default value: NULL
| << Resource Files | Bindings >> |