class TextView(Gtk.TextView): (source)
TextBuffer
with page content. Implements zim specific behavior like additional key bindings, on-mouse-over signals for links, and the custom popup menu.Unknown Field: signal | |
link-clicked (link): Emitted when the user clicks a link | |
link-enter (link): Emitted when the mouse pointer enters a link | |
link-leave (link): Emitted when the mouse pointer leaves a link | |
end-of-word (start, end, word, char, editmode): Emitted when the user typed a character like space that ends a word
Plugins that want to add auto-formatting logic can connect to this signal. If the handler matches the word it should stop the signal with stop_emission() to prevent other hooks from formatting the same word. | |
end-of-line (end): Emitted when the user typed a newline |
Method | __init__ |
Constructor |
Method | click_anchor |
Show popover for anchor under the cursor |
Method | click_checkbox |
Toggle the checkbox under the mouse pointer, if any |
Method | click_link |
Activate the link under the mouse pointer, if any |
Method | click_link_at_iter |
Activate the link at iter, if any |
Method | do_button_press_event |
Undocumented |
Method | do_button_release_event |
Undocumented |
Method | do_copy_clipboard |
Undocumented |
Method | do_cut_clipboard |
Undocumented |
Method | do_end_of_line |
Undocumented |
Method | do_end_of_word |
Undocumented |
Method | do_key_press_event |
Undocumented |
Method | do_move_cursor |
Undocumented |
Method | do_paste_clipboard |
Undocumented |
Method | do_popup_menu |
Undocumented |
Method | do_visibility_notify_event |
Undocumented |
Method | get_popup |
Get the popup menu - intended for testing |
Method | get_visual_home_positions |
Get the TextIters for the visuale start of the line |
Method | on_insert_object |
Undocumented |
Method | on_motion_notify_event |
Undocumented |
Method | on_query_tooltip |
Undocumented |
Method | on_size_allocate |
Undocumented |
Method | set_buffer |
Undocumented |
Method | test_key_press_event |
Undocumented |
Method | update_cursor |
Update the mouse cursor type |
Class Variable | __gsignals__ |
Undocumented |
Instance Variable | preferences |
dict with preferences |
Method | _do_key_press_event |
Undocumented |
Method | _do_key_press_event_default |
Undocumented |
Method | _do_key_press_event_readonly |
Undocumented |
Method | _do_key_press_event_selection |
Undocumented |
Method | _get_object_wrap_width |
Undocumented |
Method | _get_pixbuf_at_pointer |
No summary |
Method | _get_pointer_location |
Get an iter and coordinates for the mouse pointer |
Method | _get_popup_menu_mark |
Undocumented |
Method | _post_key_press_event |
Undocumented |
Method | _set_cursor |
Undocumented |
Method | _set_popup_menu_mark |
Undocumented |
Instance Variable | _cursor |
Undocumented |
Instance Variable | _cursor_link |
Undocumented |
Instance Variable | _object_widgets |
Undocumented |
Instance Variable | _object_wrap_width |
Undocumented |
Parameters | |
preferences | dict with preferences |
Unknown Field: todo | |
make sure code sets proper defaults for preferences & document preferences used |
Parameters | |
checkbox_type | the checkbox type to toggle between, see TextBuffer.toggle_checkbox() for details. |
Returns | |
True for success, False if no checkbox was found. |
Returns | |
True when there was indeed a link | |
Unknown Field: emits | |
link-clicked |
Activate the link at iter, if any
Like click_link()
but activates a link at a specific text iter location
Parameters | |
iter | a Gtk.TextIter |
Returns | |
True when there was indeed a link | |
Unknown Field: emits | |
link-clicked |
Parameters | |
iter | a Gtk.TextIter |
Returns | |
a 2-tuple with two Gtk.TextIter The first iter is the start of the visual line - which can be the start of the line as the buffer sees it (which is also called the paragraph start in the view) or the iter at the place where the line is wrapped. The second iter is the start of the line after skipping any bullets and whitespace. For a wrapped line the second iter will be the same as the first. |
Update the mouse cursor type
E.g. set a "hand" cursor when hovering over a link.
Parameters | |
coords | a tuple with (x, y) position in buffer coords. Only give this argument if coords are known from an event, otherwise the current cursor position is used. |
Unknown Field: emits | |
link-enter | |
link-leave |
_get_pointer_location()
. This method handles the special case where the pointer it on an iter next to the image but the mouse is visible above the image.