| GTK+ Reference Manual | ||||
|---|---|---|---|---|
#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);
color-hashGHashTable : Read gtk-alternative-button-ordergboolean : Read / Write gtk-alternative-sort-arrowsgboolean : Read / Write gtk-button-imagesgboolean : Read / Write gtk-can-change-accelsgboolean : Read / Write gtk-color-palettegchararray : Read / Write gtk-color-schemegchararray : Read / Write gtk-cursor-blinkgboolean : Read / Write gtk-cursor-blink-timegint : Read / Write gtk-cursor-blink-timeoutgint : Read / Write gtk-cursor-theme-namegchararray : Read / Write gtk-cursor-theme-sizegint : Read / Write gtk-dnd-drag-thresholdgint : Read / Write gtk-double-click-distancegint : Read / Write gtk-double-click-timegint : Read / Write gtk-enable-accelsgboolean : Read / Write gtk-enable-animationsgboolean : Read / Write gtk-enable-mnemonicsgboolean : Read / Write gtk-entry-password-hint-timeoutguint : Read / Write gtk-entry-select-on-focusgboolean : Read / Write gtk-error-bellgboolean : Read / Write gtk-fallback-icon-themegchararray : Read / Write gtk-file-chooser-backendgchararray : Read / Write gtk-font-namegchararray : Read / Write gtk-icon-sizesgchararray : Read / Write gtk-icon-theme-namegchararray : Read / Write gtk-key-theme-namegchararray : Read / Write gtk-keynav-cursor-onlygboolean : Read / Write gtk-keynav-wrap-aroundgboolean : Read / Write gtk-label-select-on-focusgboolean : Read / Write gtk-menu-bar-accelgchararray : Read / Write gtk-menu-bar-popup-delaygint : Read / Write gtk-menu-imagesgboolean : Read / Write gtk-menu-popdown-delaygint : Read / Write gtk-menu-popup-delaygint : Read / Write gtk-modulesgchararray : Read / Write gtk-print-backendsgchararray : Read / Write gtk-print-preview-commandgchararray : Read / Write gtk-scrolled-window-placement GtkCornerType : Read / Write gtk-show-input-method-menugboolean : Read / Write gtk-show-unicode-menugboolean : Read / Write gtk-split-cursorgboolean : Read / Write gtk-theme-namegchararray : Read / Write gtk-timeout-expandgint : Read / Write gtk-timeout-initialgint : Read / Write gtk-timeout-repeatgint : Read / Write gtk-toolbar-icon-size GtkIconSize : Read / Write gtk-toolbar-style GtkToolbarStyle : Read / Write gtk-tooltip-browse-mode-timeoutgint : Read / Write gtk-tooltip-browse-timeoutgint : Read / Write gtk-tooltip-timeoutgint : Read / Write gtk-touchscreen-modegboolean : Read / Write gtk-xft-antialiasgint : Read / Write gtk-xft-dpigint : Read / Write gtk-xft-hintinggint : Read / Write gtk-xft-hintstylegchararray : Read / Write gtk-xft-rgbagchararray : 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 |
| 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 (constGParamSpec *pspec, constGString *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 redgreenblue
pspec : |
a |
gstring : |
the |
property_value : |
a |
| Returns : | TRUEgstring could be parsed and property_value
has been set to the resulting |
gboolean gtk_rc_property_parse_enum (constGParamSpec *pspec, constGString *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 |
gstring : |
the |
property_value : |
a |
| Returns : | TRUEgstring could be parsed and property_value
has been set to the resulting |
gboolean gtk_rc_property_parse_flags (constGParamSpec *pspec, constGString *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 |
gstring : |
the |
property_value : |
a |
| Returns : | TRUEgstring could be parsed and property_value
has been set to the resulting flags value.
|
gboolean gtk_rc_property_parse_requisition (constGParamSpec *pspec, constGString *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 widthheight
pspec : |
a |
gstring : |
the |
property_value : |
a |
| Returns : | TRUEgstring could be parsed and property_value
has been set to the resulting GtkRequisition.
|
gboolean gtk_rc_property_parse_border (constGParamSpec *pspec, constGString *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
leftrighttopbottom
pspec : |
a |
gstring : |
the |
property_value : |
a |
| Returns : | TRUEgstring could be parsed and property_value
has been set to the resulting GtkBorder.
|
void gtk_settings_set_property_value (GtkSettings *settings, constgchar *name, const GtkSettingsValue *svalue);
settings : |
|
name : |
|
svalue : |
void gtk_settings_set_string_property (GtkSettings *settings, constgchar *name, constgchar *v_string, constgchar *origin);
settings : |
|
name : |
|
v_string : |
|
origin : |
void gtk_settings_set_long_property (GtkSettings *settings, constgchar *name,glong v_long, constgchar *origin);
settings : |
|
name : |
|
v_long : |
|
origin : |
void gtk_settings_set_double_property (GtkSettings *settings, constgchar *name,gdouble v_double, constgchar *origin);
settings : |
|
name : |
|
v_double : |
|
origin : |
color-hash propertycolor-hashGHashTable : Read
Holds a hash table representation of the :gtk-color-scheme
setting, mapping color names to
Since 2.10
gtk-alternative-button-order propertygtk-alternative-button-ordergboolean : Read / Write
Whether buttons in dialogs should use the alternative button order.
Default value: FALSE
gtk-alternative-sort-arrows propertygtk-alternative-sort-arrowsgboolean : Read / Write
Controls the direction of the sort indicators in sorted list and tree
views. By default an arrow pointing down means the column is sorted
in ascending order. When set to TRUE
Default value: FALSE
Since 2.12
gtk-button-images propertygtk-button-imagesgboolean : Read / Write
Whether stock icons should be shown in buttons.
Default value: TRUE
gtk-can-change-accels propertygtk-can-change-accelsgboolean : Read / Write
Whether menu accelerators can be changed by pressing a key over the menu item.
Default value: FALSE
gtk-color-palette propertygtk-color-palettegchararray : 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-color-scheme propertygtk-color-schemegchararray : Read / Write
A palette of named colors for use in themes. The format of the string is
name1: color1 name2: color2 ...
Color names must be acceptable as identifiers in the
gtkrc syntax, and
color specifications must be in the format accepted by
gdk_color_parse()
Note that due to the way the color tables from different sources are merged, color specifications will be converted to hexadecimal form when getting this property.
Starting with GTK+ 2.12, the entries can alternatively be separated by ';' instead of newlines:
name1: color1; name2: color2; ...
Default value: ""
Since 2.10
gtk-cursor-blink propertygtk-cursor-blinkgboolean : Read / Write
Whether the cursor should blink.
Also see the :gtk-cursor-blink-timeout setting, which allows more flexible control over cursor blinking.
Default value: TRUE
gtk-cursor-blink-time propertygtk-cursor-blink-timegint : Read / Write
Length of the cursor blink cycle, in milliseconds.
Allowed values: >= 100
Default value: 1200
gtk-cursor-blink-timeout propertygtk-cursor-blink-timeoutgint : Read / Write
Time after which the cursor stops blinking, in seconds. The timer is reset after each user interaction.
Setting this to zero has the same effect as setting
:gtk-cursor-blink to FALSE
Allowed values: >= 1
Default value: 2147483647
Since 2.12
gtk-cursor-theme-name propertygtk-cursor-theme-namegchararray : Read / Write
Name of the cursor theme to use, or NULL to use the default theme.
Default value: NULL
gtk-cursor-theme-size propertygtk-cursor-theme-sizegint : Read / Write
Size to use for cursors, or 0 to use the default size.
Allowed values: [0,128]
Default value: 0
gtk-dnd-drag-threshold propertygtk-dnd-drag-thresholdgint : Read / Write
Number of pixels the cursor can move before dragging.
Allowed values: >= 1
Default value: 8
gtk-double-click-distance propertygtk-double-click-distancegint : 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 propertygtk-double-click-timegint : 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-enable-accels propertygtk-enable-accelsgboolean : Read / Write
Whether menu items should have visible accelerators which can be activated.
Default value: TRUE
Since 2.12
gtk-enable-animations propertygtk-enable-animationsgboolean : Read / Write
Whether to enable toolkit-wide animations.
Default value: TRUE
gtk-enable-mnemonics propertygtk-enable-mnemonicsgboolean : Read / Write
Whether labels and menu items should have visible mnemonics which can be activated.
Default value: TRUE
Since 2.12
gtk-entry-password-hint-timeout propertygtk-entry-password-hint-timeoutguint : Read / Write
How long to show the last inputted character in hidden entries. This value is in milliseconds. 0 disables showing the last char. 600 is a good value for enabling it.
Default value: 0
Since 2.10
gtk-entry-select-on-focus propertygtk-entry-select-on-focusgboolean : Read / Write
Whether to select the contents of an entry when it is focused.
Default value: TRUE
gtk-error-bell propertygtk-error-bellgboolean : Read / Write
When TRUEgdk_window_beep()
Default value: TRUE
Since 2.12
gtk-fallback-icon-theme propertygtk-fallback-icon-themegchararray : Read / Write
Name of a icon theme to fall back to.
Default value: NULL
gtk-file-chooser-backend propertygtk-file-chooser-backendgchararray : Read / Write
Name of the GtkFileChooser backend to use by default.
Default value: NULL
gtk-font-name propertygtk-font-namegchararray : Read / Write
Name of default font to use.
Default value: "Sans 10"
gtk-icon-sizes propertygtk-icon-sizesgchararray : Read / Write
List of icon sizes (gtk-menu=16,16:gtk-button=20,20...
Default value: NULL
gtk-icon-theme-name propertygtk-icon-theme-namegchararray : Read / Write
Name of icon theme to use.
Default value: "hicolor"
gtk-key-theme-name propertygtk-key-theme-namegchararray : Read / Write
Name of key theme RC file to load.
Default value: NULL
gtk-keynav-cursor-only propertygtk-keynav-cursor-onlygboolean : Read / Write
When TRUE
Default value: FALSE
Since 2.12
gtk-keynav-wrap-around propertygtk-keynav-wrap-aroundgboolean : Read / Write
When TRUE
Default value: TRUE
Since 2.12
gtk-label-select-on-focus propertygtk-label-select-on-focusgboolean : Read / Write
Whether to select the contents of a selectable label when it is focused.
Default value: TRUE
gtk-menu-bar-accel propertygtk-menu-bar-accelgchararray : Read / Write
Keybinding to activate the menu bar.
Default value: "F10"
gtk-menu-bar-popup-delay propertygtk-menu-bar-popup-delaygint : Read / Write
Delay before the submenus of a menu bar appear.
Allowed values: >= 0
Default value: 0
gtk-menu-images propertygtk-menu-imagesgboolean : Read / Write
Whether images should be shown in menus.
Default value: TRUE
gtk-menu-popdown-delay propertygtk-menu-popdown-delaygint : 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 propertygtk-menu-popup-delaygint : Read / Write
Minimum time the pointer must stay over a menu item before the submenu appear.
Allowed values: >= 0
Default value: 225
gtk-modules propertygtk-modulesgchararray : Read / Write
List of currently active GTK modules.
Default value: NULL
gtk-print-backends propertygtk-print-backendsgchararray : Read / Write
A comma-separated list of print backends to use in the print dialog. Available print backends depend on the GTK+ installation, and may include "pdf", "cups" or "lpr".
Default value: "file,cups"
Since 2.10
gtk-print-preview-command propertygtk-print-preview-commandgchararray : Read / Write
A command to run for displaying the print preview. The command
should contain a fsgtk_print_settings_to_file().
The preview application is responsible for removing the pdf file and the print settings file when it is done.
Default value: "evince --unlink-tempfile --preview %f"
Since 2.10
gtk-scrolled-window-placement propertygtk-scrolled-window-placement GtkCornerType : Read / Write
Where the contents of scrolled windows are located with respect to the scrollbars, if not overridden by the scrolled window's own placement.
Default value: GTK_CORNER_TOP_LEFT
Since 2.10
gtk-show-input-method-menu propertygtk-show-input-method-menugboolean : Read / Write
Whether the context menus of entries and text views should offer to change the input method.
Default value: TRUE
gtk-show-unicode-menu propertygtk-show-unicode-menugboolean : Read / Write
Whether the context menus of entries and text views should offer to insert control characters.
Default value: TRUE
gtk-split-cursor propertygtk-split-cursorgboolean : Read / Write
Whether two cursors should be displayed for mixed left-to-right and right-to-left text.
Default value: TRUE
gtk-theme-name propertygtk-theme-namegchararray : Read / Write
Name of theme RC file to load.
Default value: "Raleigh"
gtk-timeout-expand propertygtk-timeout-expandgint : Read / Write
Expand value for timeouts, when a widget is expanding a new region.
Allowed values: >= 0
Default value: 500
gtk-timeout-initial propertygtk-timeout-initialgint : Read / Write
Starting value for timeouts, when button is pressed.
Allowed values: >= 0
Default value: 200
gtk-timeout-repeat propertygtk-timeout-repeatgint : Read / Write
Repeat value for timeouts, when button is pressed.
Allowed values: >= 0
Default value: 20
gtk-toolbar-icon-size propertygtk-toolbar-icon-size GtkIconSize : Read / Write
Size of icons in default toolbars.
Default value: GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style propertygtk-toolbar-style GtkToolbarStyle : Read / Write
Whether default toolbars have text only, text and icons, icons only, etc.
Default value: GTK_TOOLBAR_BOTH
gtk-tooltip-browse-mode-timeout propertygtk-tooltip-browse-mode-timeoutgint : Read / Write
Amount of time, in milliseconds, after which the browse mode will be disabled.
See :gtk-tooltip-browse-timeout for more information about browse mode.
Allowed values: >= 0
Default value: 500
Since 2.12
gtk-tooltip-browse-timeout propertygtk-tooltip-browse-timeoutgint : Read / Write
Controls the time after which tooltips will appear when browse mode is enabled, in milliseconds.
Browse mode is enabled when the mouse pointer moves off an object where a tooltip was currently being displayed. If the mouse pointer hits another object before the browse mode timeout expires (see :gtk-tooltip-browse-mode-timeout), it will take the amount of milliseconds specified by this setting to popup the tooltip for the new object.
Allowed values: >= 0
Default value: 100
Since 2.12
gtk-tooltip-timeout propertygtk-tooltip-timeoutgint : Read / Write
Time, in milliseconds, after which a tooltip could appear if the cursor is hovering on top of a widget.
Allowed values: >= 0
Default value: 1500
Since 2.12
gtk-touchscreen-mode propertygtk-touchscreen-modegboolean : Read / Write
When TRUE
Default value: FALSE
Since 2.10
gtk-xft-antialias propertygtk-xft-antialiasgint : Read / Write
Whether to antialias Xft fonts; 0=no, 1=yes, -1=default.
Allowed values: [-1,1]
Default value: -1
gtk-xft-dpi propertygtk-xft-dpigint : Read / Write
Resolution for Xft, in 1024 * dots/inch. -1 to use default value.
Allowed values: [-1,1048576]
Default value: -1
gtk-xft-hinting propertygtk-xft-hintinggint : Read / Write
Whether to hint Xft fonts; 0=no, 1=yes, -1=default.
Allowed values: [-1,1]
Default value: -1
gtk-xft-hintstyle propertygtk-xft-hintstylegchararray : Read / Write
What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull.
Default value: NULL