search¶
tkinter search functions
search_text(text, query='', match_case=False, highlight_colour='red')
¶
Set selection of strings in Text widget based on search query
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
Text
|
tk.Text |
required |
query
|
str search query |
''
|
|
match_case
|
if False, select items even if the case doesn't match |
False
|
|
highlight_colour
|
colour of the highlighted text |
'red'
|
Returns:
| Type | Description |
|---|---|
|
|
Source code in mmg_toolbox/tkguis/misc/search.py
search_tree(treeview, branch='', query='entry', match_case=False, whole_word=False)
¶
Set selection of items in treeview based on search query
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
treeview
|
Treeview
|
ttk.treeview |
required |
branch
|
ttk.treeview item (str) |
''
|
|
query
|
str search query |
'entry'
|
|
match_case
|
if False, select items even if the case doesn't match |
False
|
|
whole_word
|
if True, select only items where query matches final element of address |
False
|
Returns:
| Type | Description |
|---|---|
|
|