Class: Gtk::CssProvider

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#load_from_data(data, length) ⇒ TrueClass

Loads data into css_provider, and by doing so clears any previously loaded information.

Parameters:

  • data (Array<Integer>)

    CSS data loaded in memory

  • length (Gtk::gssize)

    the length of data in bytes, or -1 for NUL terminated strings. If length is not -1, the code will assume it is not NUL terminated and will potentially do a copy.

Returns:

  • (TrueClass)

    true. The return value is deprecated and false will only be returned for backwards compatibility reasons if an error is not nil and a loading error occurred. To track errors while loading CSS, connect to the Gtk::CssProvider::parsing-error signal.

#load_from_file(file) ⇒ TrueClass

Loads the data contained in file into css_provider, making it clear any previously loaded information.

Parameters:

  • file (Gio::File)

    #GFile pointing to a file to load

Returns:

  • (TrueClass)

    true. The return value is deprecated and false will only be returned for backwards compatibility reasons if an error is not nil and a loading error occurred. To track errors while loading CSS, connect to the Gtk::CssProvider::parsing-error signal.

#load_from_path(path) ⇒ TrueClass

Loads the data contained in path into css_provider, making it clear any previously loaded information.

Parameters:

  • path (String)

    the path of a filename to load, in the GLib filename encoding

Returns:

  • (TrueClass)

    true. The return value is deprecated and false will only be returned for backwards compatibility reasons if an error is not nil and a loading error occurred. To track errors while loading CSS, connect to the Gtk::CssProvider::parsing-error signal.

#load_from_resource(resource_path) ⇒ nil

Loads the data contained in the resource at resource_path into the Gtk::CssProvider, clearing any previously loaded information.

To track errors while loading CSS, connect to the Gtk::CssProvider::parsing-error signal.

Parameters:

  • resource_path (String)

    a #GResource resource path

Returns:

  • (nil)

#newGtk::CssProvider

Returns a newly created Gtk::CssProvider.

Returns:

#to_stringString

Converts the provider into a string representation in CSS format.

Using gtk_css_provider_load_from_data() with the return value from this function on a new provider created with gtk_css_provider_new() will basically create a duplicate of this provider.

Returns:

  • (String)

    a new string representing the provider.