GtkSource.SnippetContext¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The signal is emitted when a change has been discovered in one of the chunks of the snippet which has caused a variable or other dynamic data within the context to have changed. |
Fields¶
- Inherited:
Class Details¶
- class GtkSource.SnippetContext(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Context for expanding [class`SnippetChunk`].
This class is currently used primary as a hashtable. However, the longer term goal is to have it hold onto a
GjsContext
as well as other languages so that [class`SnippetChunk`] can expand themselves by executing script within the context.The [class`Snippet`] will build the context and then expand each of the chunks during the insertion/edit phase.
- classmethod new()¶
- Returns:
- Return type:
Creates a new
GtkSource.SnippetContext
.Generally, this isn’t needed unless you are controlling the expansion of snippets manually.
- clear_variables()¶
Removes all variables from the context.
- get_variable(key)¶
- Parameters:
key (
str
) – the name of the variable- Returns:
the value for the variable, or
None
- Return type:
Gets the current value for a variable named key.
- set_constant(key, value)¶
-
Sets a constatnt within the context.
This is similar to a variable set with [method`SnippetContext`.set_variable] but is expected to not change during use of the snippet.
Examples would be the date or users name.
Signal Details¶
- GtkSource.SnippetContext.signals.changed(snippet_context)¶
- Signal Name:
changed
- Flags:
- Parameters:
snippet_context (
GtkSource.SnippetContext
) – The object which received the signal
The signal is emitted when a change has been discovered in one of the chunks of the snippet which has caused a variable or other dynamic data within the context to have changed.