gtk.Settings

gtk.Settings — an object that contains the global settings for the widgets on a gtk.gdk.Screen

Synopsis

class gtk.Settings(gobject.GObject):
    def set_string_property(name, v_string, origin)
def set_long_property(name, v_long, origin)
def set_double_property(name, v_double, origin)
Functions

    def gtk.settings_get_default()
def gtk.settings_get_for_screen(screen)

Ancestry

+-- gobject.GObject
  +-- gtk.Settings

gtk.Settings Properties

"color-hash"ReadHolds a hash table representation of the gtk-color-scheme setting, mapping color names to gtk.gdk.Colors. This property is available in GTK+ 2.10 and above.
"gtk-alternative-button-order"Read-WriteIf TRUE, buttons in dialogs should use the alternative button order. Available in GTK+ 2.6 and above. Default value: FALSE
"gtk-button-images"Read-WriteIf TRUE, stock icons should be shown in buttons. Available in GTK+ 2.4 and above. Default value: TRUE
"gtk-can-change-accels"Read-WriteIf TRUE, the menu accelerators can be changed by pressing a key over the menu item. Default value: FALSE
"gtk-color-palette"Read-WriteThe 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"Read-WriteA 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 gtk.RcStyle syntax, and color specifications must be in the format accepted by the gtk.gdk.color_parse() function. 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. Default value: ''. This property is available in GTK+ 2.10 and above.
"gtk-cursor-blink"Read-WriteIf TRUE, the cursor should blink. Default value: TRUE
"gtk-cursor-blink-time"Read-WriteThe length of the cursor blink cycle, in milliseconds. Allowed values: >= 100. Default value: 1200
"gtk-cursor-theme-name"Read-WriteName of the cursor theme to use, or None to use the default theme. Default value: None
"gtk-cursor-theme-size"Read-WriteSize to use for cursors, or 0 to use the default size. Allowed values: [0,128]. Default value: 0.
"gtk-dnd-drag-threshold"Read-WriteThe number of pixels the cursor can move before dragging starts. Allowed values: >= 1. Default value: 8
"gtk-double-click-distance"Read-WriteThe maximum distance allowed between two clicks for them to be considered a double click (in pixels). Available in GTK+ 2.4 and above. Allowed values: >= 0. Default value: 5
"gtk-double-click-time"Read-WriteThe maximum time allowed between two clicks for them to be considered a double click (in milliseconds). Allowed values: >= 0. Default value: 250
"gtk-enable-animations"Read-WriteIf TRUE enable toolkit-wide animations. Default value: TRUE.
"gtk-entry-password-hint-timeout"Read-WriteHow long to show the last input 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. This property is available in GTK+ 2.10 and above.
"gtk-entry-select-on-focus"Read-WriteIf TRUE, select the contents of an entry when it is focused. Default value: TRUE
"gtk-fallback-icon-theme"Read-WriteName of a icon theme to fall back to. Default value: None.
"gtk-font-name"Read-WriteThe name of the default font to use. Default value: "Sans 10"
"gtk-icon-sizes"Read-WriteThe list of icon sizes (gtk-menu=16,16;gtk-button=20,20...). Default value: None
"gtk-icon-theme-name"Read-WriteThe name of the icon theme to use. Available in GTK+ 2.4 and above. Default value: "hicolor"
"gtk-key-theme-name"Read-WriteThe name of the key theme RC file to load. Default value: None
"gtk-label-select-on-focus"Read-WriteIf TRUE select the contents of a selectable label when it is focused. Default value: TRUE.
"gtk-menu-bar-accel"Read-WriteThe keybinding to activate the menu bar. Default value: "F10"
"gtk-menu-bar-popup-delay"Read-WriteThe delay before the submenus of a menu bar appear. Allowed values: >= 0. Default value: 0 Available in GTK+ 2.2 and above.
"gtk-menu-images"Read-WriteIf TRUE images should be shown in menus. Default value: TRUE. Available in GTK+ 2.4 and above.
"gtk-menu-popdown-delay"Read-WriteThe time before hiding a submenu when the pointer is moving toward the submenu. Allowed values: >= 0. Default value: 1000. Available in GTK+ 2.2 and above.
"gtk-menu-popup-delay"Read-WriteMinimum time the pointer must stay over a menu item before the submenu appears. Allowed values: >= 0. Default value: 225. Available in GTK+ 2.2 and above.
"gtk-modules"Read-WriteThe list of currently active GTK modules. Default value: None. Available in GTK+ 2.6 and above.
"gtk-scrolled-window-placement"Read-WriteWhere 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.
"gtk-show-input-method-menu"Read-WriteIf TRUE the context menus of entries and text views should offer to change the input method. Default value: TRUE.
"gtk-show-unicode-menu"Read-WriteIf TRUE the context menus of entries and text views should offer to insert control characters. Default value: TRUE.
"gtk-split-cursor"Read-WriteIf TRUE, two cursors should be displayed for mixed left-to-right and right-to-left text. Default value: TRUE
"gtk-theme-name"Read-WriteThe name of the theme RC file to load. Default value: "Raleigh"
"gtk-timeout-expand"Read-WriteExpand value for timeouts, when a widget is expanding a new region. Allowed values: >= 0. Default value: 500.
"gtk-timeout-initial"Read-WriteStarting value for timeouts, when button is pressed. Allowed values: >= 0. Default value: 200.
"gtk-timeout-repeat"Read-WriteRepeat value for timeouts, when button is pressed. Allowed values: >= 0. Default value: 20.
"gtk-toolbar-icon-size"Read-Writethe toolbar icon size - one of: gtk.ICON_SIZE_MENU, gtk.ICON_SIZE_SMALL_TOOLBAR, gtk.ICON_SIZE_LARGE_TOOLBAR, gtk.ICON_SIZE_BUTTON, gtk.ICON_SIZE_DND or gtk.ICON_SIZE_DIALOG. Default value: gtk.ICON_SIZE_LARGE_TOOLBAR.
"gtk-toolbar-style"Read-WriteThe toolbar display style - one of: gtk.TOOLBAR_ICONS, gtk.TOOLBAR_TEXT, gtk.TOOLBAR_BOTH or gtk.TOOLBAR_BOTH_HORIZ. Default value: gtk.TOOLBAR_BOTH
"gtk-touchscreen-mode"Read-WriteWhen TRUE, there are no motion notify events delivered on this screen, and widgets can't use the pointer hovering them for any essential functionality. Default value: FALSE. This property is available in GTK+ 2.10 and above.
"gtk-xft-antialias"Read-WriteWhether to antialias Xft fonts; 0=no, 1=yes, -1=default. Default value: -1. Available in GTK+ 2.4 and above.
"gtk-xft-dpi"Read-WriteResolution for Xft, in 1024 * dots/inch. -1 to use default value. Allowed values: [-1,1048576]. Default value: -1. Available in GTK+ 2.4 and above.
"gtk-xft-hinting"Read-WriteWhether to hint Xft fonts; 0=no, 1=yes, -1=default. Default value: -1. Available in GTK+ 2.4 and above.
"gtk-xft-hintstyle"Read-WriteWhat degree of hinting to use; none, slight, medium, or full. Default value: None. Available in GTK+ 2.4 and above.
"gtk-xft-rgba"Read-WriteType of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr. Default value: None. Available in GTK+ 2.4 and above.

Description

The gtk.Settings object stores the values of the global settings associated with a gtk.gdk.Screen. The gtk.Settings object for the default gtk.gdk.Screen can be retrieved using the gtk.settings_get_default() function. The gtk.Widget.get_settings() method returns the gtk.Settings object of the gtk.gdk.Screen that the widget is displayed on.

Methods

gtk.Settings.set_string_property

    def set_string_property(name, v_string, origin)
name :the name of the property to set
v_string :the string value
origin :the string value of the origin

The set_string_property() method sets the property named name to the string value specified by v_string at the string origin specified by origin. origin is an application specified string like "filename:linenumber" or "myapp:widgetname".

gtk.Settings.set_long_property

    def set_long_property(name, v_long, origin)
name :the name of the property to set
v_long :the long value
origin :the string value of the origin

The set_long_property() method sets the property named name to the long value specified by v_long at the string origin specified by origin. origin is an application specified string like "filename:linenumber" or "myapp:widgetname".

gtk.Settings.set_double_property

    def set_double_property(name, v_double, origin)
name :the name of the property to set
v_double :the double value
origin :the string value of the origin

The set_double_property() method sets the property named name to the double value specified by v_long at the string origin specified by origin. origin is an application specified string like "filename:linenumber" or "myapp:widgetname".

Functions

gtk.settings_get_default

    def gtk.settings_get_default()
Returns :the singleton gtk.Settings object

The gtk.settings_get_default function returns the singleton gtk.Settings object.

gtk.settings_get_for_screen

    def gtk.settings_get_for_screen(screen)
screen :a gtk.gdk.Screen object
Returns :a gtk.Settings object

Note

This function is available in PyGTK 2.2 and above.

The gtk.settings_get_for_screen() function returns the singleton gtk.Settings object for the gtk.gdk.Screen specified by screen.