GtkSource.CompletionProposal

g GObject.GInterface GObject.GInterface GtkSource.CompletionProposal GtkSource.CompletionProposal GObject.GInterface->GtkSource.CompletionProposal

Implementations:
 GtkSource.CompletionItem

Methods

  changed ()
  equal (other)
  get_gicon ()
  get_icon ()
  get_icon_name ()
  get_info ()
  get_label ()
  get_markup ()
  get_text ()
  hash ()

Virtual Methods

  do_changed ()
  do_equal (other)
  do_get_gicon ()
  do_get_icon ()
  do_get_icon_name ()
  do_get_info ()
  do_get_label ()
  do_get_markup ()
  do_get_text ()
  do_hash ()

Properties

None

Signals

Name Short Description
changed Emitted when the proposal has changed.

Fields

None

Class Details

class GtkSource.CompletionProposal
Bases:GObject.GInterface
Structure:GtkSource.CompletionProposalIface
changed()

Emits the “changed” signal on self. This should be called by implementations whenever the name, icon or info of the proposal has changed.

equal(other)
Parameters:other (GtkSource.CompletionProposal) – a GtkSource.CompletionProposal.
Returns:True if self and object are the same proposal
Return type:bool

Get whether two proposal objects are the same. This is used to (together with GtkSource.CompletionProposal.hash()) to match proposals in the completion model. By default, it uses direct equality (GLib.direct_equal()).

get_gicon()
Returns:A Gio.Icon with the icon of self.
Return type:Gio.Icon or None

Gets the Gio.Icon for the icon of self.

New in version 3.18.

get_icon()
Returns:A GdkPixbuf.Pixbuf with the icon of self.
Return type:GdkPixbuf.Pixbuf or None

Gets the GdkPixbuf.Pixbuf for the icon of self.

get_icon_name()
Returns:The icon name of self.
Return type:str or None

Gets the icon name of self.

New in version 3.18.

get_info()
Returns:a newly-allocated string containing extra information of self or None if no extra information is associated to self.
Return type:str or None

Gets extra information associated to the proposal. This information will be used to present the user with extra, detailed information about the selected proposal. The returned string must be freed with GLib.free().

get_label()
Returns:a new string containing the label of self.
Return type:str

Gets the label of self. The label is shown in the list of proposals as plain text. If you need any markup (such as bold or italic text), you have to implement GtkSource.CompletionProposal.get_markup(). The returned string must be freed with GLib.free().

get_markup()
Returns:a new string containing the label of self with markup.
Return type:str

Gets the label of self with markup. The label is shown in the list of proposals and may contain markup. This will be used instead of GtkSource.CompletionProposal.get_label() if implemented. The returned string must be freed with GLib.free().

get_text()
Returns:a new string containing the text of self.
Return type:str

Gets the text of self. The text that is inserted into the text buffer when the proposal is activated by the default activation. You are free to implement a custom activation handler in the provider and not implement this function. For more information, see GtkSource.CompletionProvider.activate_proposal(). The returned string must be freed with GLib.free().

hash()
Returns:The hash value of self.
Return type:int

Get the hash value of self. This is used to (together with GtkSource.CompletionProposal.equal()) to match proposals in the completion model. By default, it uses a direct hash (GLib.direct_hash()).

do_changed() virtual

Emits the “changed” signal on proposal. This should be called by implementations whenever the name, icon or info of the proposal has changed.

do_equal(other) virtual
Parameters:other (GtkSource.CompletionProposal) – a GtkSource.CompletionProposal.
Returns:True if proposal and object are the same proposal
Return type:bool

Get whether two proposal objects are the same. This is used to (together with GtkSource.CompletionProposal.hash()) to match proposals in the completion model. By default, it uses direct equality (GLib.direct_equal()).

do_get_gicon() virtual
Returns:A Gio.Icon with the icon of proposal.
Return type:Gio.Icon or None

Gets the Gio.Icon for the icon of proposal.

New in version 3.18.

do_get_icon() virtual
Returns:A GdkPixbuf.Pixbuf with the icon of proposal.
Return type:GdkPixbuf.Pixbuf or None

Gets the GdkPixbuf.Pixbuf for the icon of proposal.

do_get_icon_name() virtual
Returns:The icon name of proposal.
Return type:str or None

Gets the icon name of proposal.

New in version 3.18.

do_get_info() virtual
Returns:a newly-allocated string containing extra information of proposal or None if no extra information is associated to proposal.
Return type:str or None

Gets extra information associated to the proposal. This information will be used to present the user with extra, detailed information about the selected proposal. The returned string must be freed with GLib.free().

do_get_label() virtual
Returns:a new string containing the label of proposal.
Return type:str

Gets the label of proposal. The label is shown in the list of proposals as plain text. If you need any markup (such as bold or italic text), you have to implement GtkSource.CompletionProposal.get_markup(). The returned string must be freed with GLib.free().

do_get_markup() virtual
Returns:a new string containing the label of proposal with markup.
Return type:str

Gets the label of proposal with markup. The label is shown in the list of proposals and may contain markup. This will be used instead of GtkSource.CompletionProposal.get_label() if implemented. The returned string must be freed with GLib.free().

do_get_text() virtual
Returns:a new string containing the text of proposal.
Return type:str

Gets the text of proposal. The text that is inserted into the text buffer when the proposal is activated by the default activation. You are free to implement a custom activation handler in the provider and not implement this function. For more information, see GtkSource.CompletionProvider.activate_proposal(). The returned string must be freed with GLib.free().

do_hash() virtual
Returns:The hash value of proposal.
Return type:int

Get the hash value of proposal. This is used to (together with GtkSource.CompletionProposal.equal()) to match proposals in the completion model. By default, it uses a direct hash (GLib.direct_hash()).

Signal Details

GtkSource.CompletionProposal.signals.changed(completion_proposal)
Signal Name:changed
Flags:RUN_LAST, ACTION
Parameters:completion_proposal (GtkSource.CompletionProposal) – The object which received the signal

Emitted when the proposal has changed. The completion popup will react to this by updating the shown information.