GtkSource.MarkAttributes

g GObject.Object GObject.Object GtkSource.MarkAttributes GtkSource.MarkAttributes GObject.Object->GtkSource.MarkAttributes

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_background ()

get_gicon ()

get_icon_name ()

get_pixbuf ()

get_stock_id ()

get_tooltip_markup (mark)

get_tooltip_text (mark)

render_icon (widget, size)

set_background (background)

set_gicon (gicon)

set_icon_name (icon_name)

set_pixbuf (pixbuf)

set_stock_id (stock_id)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

background

Gdk.RGBA

r/w

The background

gicon

Gio.Icon

r/w

The Gio.Icon

icon-name

str

r/w

The icon name

pixbuf

GdkPixbuf.Pixbuf

r/w

The pixbuf

stock-id

str

d/r/w

The stock id deprecated

Signals

Inherited:

GObject.Object (1)

Name

Short Description

query-tooltip-markup

The code should connect to this signal to provide a tooltip for given mark.

query-tooltip-text

The code should connect to this signal to provide a tooltip for given mark.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class GtkSource.MarkAttributes(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GtkSource.MarkAttributesClass

classmethod new()
Returns:

a new source mark attributes.

Return type:

GtkSource.MarkAttributes

Creates a new source mark attributes.

get_background()
Returns:

whether background color for self was set.

background:

a Gdk.RGBA.

Return type:

(bool, background: Gdk.RGBA)

Stores background color in background.

get_gicon()
Returns:

An icon. The icon belongs to self and should not be unreffed.

Return type:

Gio.Icon

Gets a Gio.Icon to be used as a base for rendered icon. Note that the icon can be None if it wasn’t set earlier.

get_icon_name()
Returns:

An icon name. The string belongs to self and should not be freed.

Return type:

str

Gets a name of an icon to be used as a base for rendered icon. Note that the icon name can be None if it wasn’t set earlier.

get_pixbuf()
Returns:

A pixbuf. The pixbuf belongs to self and should not be unreffed.

Return type:

GdkPixbuf.Pixbuf

Gets a GdkPixbuf.Pixbuf to be used as a base for rendered icon. Note that the pixbuf can be None if it wasn’t set earlier.

get_stock_id()
Returns:

Stock id. Returned string is owned by self and shouldn’t be freed.

Return type:

str

Gets a stock id of an icon used by this attributes. Note that the stock id can be None if it wasn’t set earlier.

Deprecated since version 3.10: Don’t use this function.

get_tooltip_markup(mark)
Parameters:

mark (GtkSource.Mark) – a GtkSource.Mark.

Returns:

A tooltip. The returned string should be freed by using GLib.free() when done with it.

Return type:

str

Queries for a tooltip by emitting a GtkSource.MarkAttributes ::query-tooltip-markup signal. The tooltip may contain a markup.

get_tooltip_text(mark)
Parameters:

mark (GtkSource.Mark) – a GtkSource.Mark.

Returns:

A tooltip. The returned string should be freed by using GLib.free() when done with it.

Return type:

str

Queries for a tooltip by emitting a GtkSource.MarkAttributes ::query-tooltip-text signal. The tooltip is a plain text.

render_icon(widget, size)
Parameters:
  • widget (Gtk.Widget) – widget of which style settings may be used.

  • size (int) – size of the rendered icon.

Returns:

A rendered pixbuf. The pixbuf belongs to self and should not be unreffed.

Return type:

GdkPixbuf.Pixbuf

Renders an icon of given size. The base of the icon is set by the last call to one of: GtkSource.MarkAttributes.set_pixbuf(), GtkSource.MarkAttributes.set_gicon(), GtkSource.MarkAttributes.set_icon_name() or GtkSource.MarkAttributes.set_stock_id(). size cannot be lower than 1.

set_background(background)
Parameters:

background (Gdk.RGBA) – a Gdk.RGBA.

Sets background color to the one given in background.

set_gicon(gicon)
Parameters:

gicon (Gio.Icon) – a Gio.Icon to be used.

Sets an icon to be used as a base for rendered icon.

set_icon_name(icon_name)
Parameters:

icon_name (str) – name of an icon to be used.

Sets a name of an icon to be used as a base for rendered icon.

set_pixbuf(pixbuf)
Parameters:

pixbuf (GdkPixbuf.Pixbuf) – a GdkPixbuf.Pixbuf to be used.

Sets a pixbuf to be used as a base for rendered icon.

set_stock_id(stock_id)
Parameters:

stock_id (str) – a stock id.

Sets stock id to be used as a base for rendered icon.

Deprecated since version 3.10: Don’t use this function.

Signal Details

GtkSource.MarkAttributes.signals.query_tooltip_markup(mark_attributes, mark)
Signal Name:

query-tooltip-markup

Flags:

RUN_LAST

Parameters:
Returns:

A tooltip. The string should be freed with GLib.free() when done with it.

Return type:

str

The code should connect to this signal to provide a tooltip for given mark. The tooltip can contain a markup.

GtkSource.MarkAttributes.signals.query_tooltip_text(mark_attributes, mark)
Signal Name:

query-tooltip-text

Flags:

RUN_LAST

Parameters:
Returns:

A tooltip. The string should be freed with GLib.free() when done with it.

Return type:

str

The code should connect to this signal to provide a tooltip for given mark. The tooltip should be just a plain text.

Property Details

GtkSource.MarkAttributes.props.background
Name:

background

Type:

Gdk.RGBA

Default Value:

None

Flags:

READABLE, WRITABLE

A color used for background of a line.

GtkSource.MarkAttributes.props.gicon
Name:

gicon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, WRITABLE

A Gio.Icon that may be a base of a rendered icon.

GtkSource.MarkAttributes.props.icon_name
Name:

icon-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

An icon name that may be a base of a rendered icon.

GtkSource.MarkAttributes.props.pixbuf
Name:

pixbuf

Type:

GdkPixbuf.Pixbuf

Default Value:

None

Flags:

READABLE, WRITABLE

A GdkPixbuf.Pixbuf that may be a base of a rendered icon.

GtkSource.MarkAttributes.props.stock_id
Name:

stock-id

Type:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE

A stock id that may be a base of a rendered icon.

Deprecated since version 3.10: Don’t use this property.