class documentation

class PageEntry(InputEntry): (source)

Known subclasses: zim.gui.widgets.LinkEntry, zim.gui.widgets.NamespaceEntry

View In Hierarchy

Widget to select a zim page path

This widget features completion for existing page names and shows whether the entered text is not a valid page name.

The page paths can be shown eitehr absolute or relative. If a reference path is given paths will be shown relative to this reference.

Method __init__ Constructor
Method get_path No summary
Method set_path Set the path to be shown in the entry. If you have the link as a string, use set_text() instead
Method set_use_relative_paths Set the notebook and path to be used for relative paths.
Method update_completion Undocumented
Method update_input_valid Undocumented
Instance Variable existing_only Undocumented
Instance Variable notebook Undocumented
Instance Variable notebookpath Undocumented
Instance Variable subpaths_only Undocumented
Method _fill_completion_any Undocumented
Method _fill_completion_for_anchor Undocumented
Class Variable _allow_select_root Undocumented

Inherited from InputEntry:

Method clear Clear the text in the entry
Method do_input_valid_changed Undocumented
Method get_input_valid Get the valid state. @returns: True if the input is valid
Method get_text Get the text from the widget. Like Gtk.Entry.get_text() but with UTF-8 decoding and whitespace stripped. @returns: string
Method set_check_func Set a function to check whether input is valid or not @param check_func: the function
Method set_icon Add an icon in the entry widget behind the text
Method set_icon_to_clear Adds a "clear" icon in the entry widget
Method set_input_valid No summary
Constant ERROR_COLOR Undocumented
Class Variable __gsignals__ Undocumented
Instance Variable allow_empty Undocumented
Instance Variable allow_whitespace Undocumented
Instance Variable check_func Undocumented
Instance Variable show_empty_invalid Undocumented
Instance Variable _input_valid Undocumented
Instance Variable _normal_color Undocumented
def __init__(self, notebook, path=None, subpaths_only=False, existing_only=False): (source)
Constructor
Parameters
notebookthe Notebook object for resolving paths and completing existing pages, but allowed to be None e.g. for testing
patha Path object used for resolving relative links
subpaths_onlyif True the input will always be considered a child 'path'
existing_onlyif True only allow to select existing pages
Note
'subpaths_only' and 'existing_only' can also be set using the like named attributes
def get_path(self): (source)
Get the path shown in the widget. If None is returned the widget is flagged as invalid. So e.g. in a dialog you can get a path and refuse to close a dialog if the path is None and the user will automatically be alerted to the missing input.
Returns
a Path object or None is no valid path was entered
def set_path(self, path): (source)
Set the path to be shown in the entry. If you have the link as a string, use set_text() instead
Parameters
pathPath object
def set_use_relative_paths(self, notebook, path=None): (source)
Set the notebook and path to be used for relative paths.
Parameters
notebookthe Notebook object for resolving paths and completing existing pages, or None to disable relative paths.
patha Path object used for resolving relative links
def update_completion(self): (source)

Undocumented

def update_input_valid(self): (source)
existing_only = (source)

Undocumented

notebook = (source)

Undocumented

notebookpath = (source)

Undocumented

subpaths_only = (source)

Undocumented

def _fill_completion_any(self, path, text): (source)

Undocumented

def _fill_completion_for_anchor(self, path, prefix, text): (source)

Undocumented

_allow_select_root: bool = (source)

Undocumented