GtkSource.Completion¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
Number of proposal accelerators to show |
||
r/w/c |
Completion popup delay for interactive completion |
||
r/w/c |
Proposal scrolling page size |
||
r/w/c |
Provider scrolling page size |
||
r/w/c |
Remember the last info window visibility state |
||
r/w/c |
Select first proposal when completion is shown |
||
r/w/c |
Show provider headers when proposals from multiple providers are available |
||
r/w/c |
Show provider and proposal icons in the completion popup |
||
r/w/co |
The |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
|
Emitted when the completion window is hidden. |
|
The |
|
The |
|
Emitted just before starting to populate the completion with providers. |
|
Emitted when the completion window is shown. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GtkSource.Completion(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- add_provider(provider)¶
- Parameters:
provider (
GtkSource.CompletionProvider
) – aGtkSource.CompletionProvider
.- Raises:
- Returns:
True
if provider was successfully added, otherwise if error is provided, it will be set with the error andFalse
is returned.- Return type:
Add a new
GtkSource.CompletionProvider
to the completion object. This will add a reference provider, so make sure to unref your own copy when you no longer need it.
- block_interactive()¶
Block interactive completion. This can be used to disable interactive completion when inserting or deleting text from the buffer associated with the completion. Use
GtkSource.Completion.unblock_interactive
() to enable interactive completion again.This function may be called multiple times. It will continue to block interactive completion until
GtkSource.Completion.unblock_interactive
() has been called the same number of times.
- create_context(position)¶
- Parameters:
position (
Gtk.TextIter
orNone
) – aGtk.TextIter
, orNone
.- Returns:
a new
GtkSource.CompletionContext
. The reference being returned is a ‘floating’ reference, so if you invokeGtkSource.Completion.start
() with this context you don’t need to unref it.- Return type:
Create a new
GtkSource.CompletionContext
for self. The position where the completion occurs can be specified by position. If position isNone
, the current cursor position will be used.
- get_info_window()¶
- Returns:
The
GtkSource.CompletionInfo
window associated with self.- Return type:
The info widget is the window where the completion displays optional extra information of the proposal.
- get_providers()¶
- Returns:
list of
GtkSource.CompletionProvider
.- Return type:
Get list of providers registered on self. The returned list is owned by the completion and should not be freed.
- get_view()¶
- Returns:
The
GtkSource.View
associated with self, orNone
.- Return type:
The
GtkSource.View
associated with self, orNone
if the view has been destroyed.
- hide()¶
Hides the completion if it is active (visible).
- remove_provider(provider)¶
- Parameters:
provider (
GtkSource.CompletionProvider
) – aGtkSource.CompletionProvider
.- Raises:
- Returns:
True
if provider was successfully removed, otherwise if error is provided, it will be set with the error andFalse
is returned.- Return type:
Remove provider from the completion.
- start(providers, context)¶
- Parameters:
providers ([
GtkSource.CompletionProvider
] orNone
) – a list ofGtkSource.CompletionProvider
, orNone
.context (
GtkSource.CompletionContext
) – TheGtkSource.CompletionContext
with which to start the completion.
- Returns:
True
if it was possible to the show completion window.- Return type:
Starts a new completion with the specified
GtkSource.CompletionContext
and a list of potential candidate providers for completion.It can be convenient for showing a completion on-the-fly, without the need to add or remove providers to the
GtkSource.Completion
.Another solution is to add providers with
GtkSource.Completion.add_provider
(), and implementGtkSource.CompletionProvider.match
() for each provider.
- unblock_interactive()¶
Unblock interactive completion. This can be used after using
GtkSource.Completion.block_interactive
() to enable interactive completion again.
- do_activate_proposal() virtual¶
- do_hide() virtual¶
Hides the completion if it is active (visible).
- do_move_cursor(step, num) virtual¶
- Parameters:
step (
Gtk.ScrollStep
) –num (
int
) –
- do_move_page(step, num) virtual¶
- Parameters:
step (
Gtk.ScrollStep
) –num (
int
) –
- do_populate_context(context) virtual¶
- Parameters:
context (
GtkSource.CompletionContext
) –
- do_proposal_activated(provider, proposal) virtual¶
- Parameters:
provider (
GtkSource.CompletionProvider
) –proposal (
GtkSource.CompletionProposal
) –
- Return type:
- do_show() virtual¶
Signal Details¶
- GtkSource.Completion.signals.activate_proposal(completion)¶
- Signal Name:
activate-proposal
- Flags:
- Parameters:
completion (
GtkSource.Completion
) – The object which received the signal
The
GtkSource.Completion
::activate-proposal
signal is a keybinding signal which gets emitted when the user initiates a proposal activation.Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the proposal activation programmatically.
- GtkSource.Completion.signals.hide(completion)¶
- Signal Name:
hide
- Flags:
- Parameters:
completion (
GtkSource.Completion
) – The object which received the signal
Emitted when the completion window is hidden. The default handler will actually hide the window.
- GtkSource.Completion.signals.move_cursor(completion, step, num)¶
- Signal Name:
move-cursor
- Flags:
- Parameters:
completion (
GtkSource.Completion
) – The object which received the signalstep (
Gtk.ScrollStep
) – TheGtk.ScrollStep
by which to move the cursornum (
int
) – The amount of steps to move the cursor
The
GtkSource.Completion
::move-cursor
signal is a keybinding signal which gets emitted when the user initiates a cursor movement.The Up, Down,
PageUp, PageDown, Home and End keys are bound to the normal behavior expected by those keys.
When step is equal to
Gtk.ScrollStep.PAGES
, the page size is defined by theGtkSource.Completion
:proposal-page-size
property. It is used for the PageDown and PageUp keys.Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.
- GtkSource.Completion.signals.move_page(completion, step, num)¶
- Signal Name:
move-page
- Flags:
- Parameters:
completion (
GtkSource.Completion
) – The object which received the signalstep (
Gtk.ScrollStep
) – TheGtk.ScrollStep
by which to move the pagenum (
int
) – The amount of steps to move the page
The
GtkSource.Completion
::move-page
signal is a keybinding signal which gets emitted when the user initiates a page movement (i.e. switches between provider pages).Control + Left is for going to the previous provider.
Control + Right is for going to the next provider.
Control + Home is for displaying all the providers.
Control + End is for going to the last provider.
When step is equal to
Gtk.ScrollStep.PAGES
, the page size is defined by theGtkSource.Completion
:provider-page-size
property.Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the page selection programmatically.
- GtkSource.Completion.signals.populate_context(completion, context)¶
- Signal Name:
populate-context
- Flags:
- Parameters:
completion (
GtkSource.Completion
) – The object which received the signalcontext (
GtkSource.CompletionContext
) – TheGtkSource.CompletionContext
for the current completion
Emitted just before starting to populate the completion with providers. You can use this signal to add additional attributes in the context.
- GtkSource.Completion.signals.show(completion)¶
- Signal Name:
show
- Flags:
- Parameters:
completion (
GtkSource.Completion
) – The object which received the signal
Emitted when the completion window is shown. The default handler will actually show the window.
Property Details¶
- GtkSource.Completion.props.accelerators¶
-
Number of keyboard accelerators to show for the first proposals. For example, to activate the first proposal, the user can press
Alt + 1.
- GtkSource.Completion.props.auto_complete_delay¶
-
Determines the popup delay (in milliseconds) at which the completion will be shown for interactive completion.
- GtkSource.Completion.props.proposal_page_size¶
-
The scroll page size of the proposals in the completion window. In other words, when PageDown or
PageUp is pressed, the selected proposal becomes the one which is located one page size backward or forward.
See also the
GtkSource.Completion
::move-cursor
signal.
- GtkSource.Completion.props.provider_page_size¶
-
The scroll page size of the provider pages in the completion window.
See the
GtkSource.Completion
::move-page
signal.
- GtkSource.Completion.props.remember_info_visibility¶
-
Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.
- GtkSource.Completion.props.select_on_show¶
-
Determines whether the first proposal should be selected when the completion is first shown.
- GtkSource.Completion.props.show_headers¶
-
Determines whether provider headers should be shown in the proposal list. It can be useful to disable when there is only one provider.
- GtkSource.Completion.props.show_icons¶
-
Determines whether provider and proposal icons should be shown in the completion popup.
- GtkSource.Completion.props.view¶
- Name:
view
- Type:
- Default Value:
- Flags:
The
GtkSource.View
bound to the completion object.