Today I released version `0.3` of my language learning tool "Xiaolong Dictionary" [1].

New features include:

(1) context menu with basic text editing functionality for the custom text entry widget
(2) context menu for the vocabulary treeview, from which one can (3) copy treeview content of selected words, (4) open a window for bulk editing tags of words, and (5) open a window displaying attributes of words

[1]: https://codeberg.org/ZelphirKaltstahl/xiaolong-dictionary/releases/tag/v0.3

#python #tkinter #mandarin #gui #code #programming

v0.3 - ZelphirKaltstahl/xiaolong-dictionary

# Changes * added some useful context menu functions for the vocabulary treeview (table): * view details of selected word * view and bulk edit tags of all selected words * copy treeview content of selected words # GNU/Linux no additional notes # Windows no additional notes

Codeberg.org

The tag editing window is very useful for when one doesn't want to go and open the vocabulary file in a text editor and edit everything by hand. Instead one can now search for any subset of words (through the powerful search function that allows you to find _any_ subset you want) and then set tags for all resulting words, or a selection of those.

It uses a custom widget called a "TagListWidget", which flows "TagWidget"s to a new line, if they would take too much space and overflow on the right.

Getting the flowing behavior working correctly was quite some work and I even experienced a segmentation fault (in Python!), which fortunately I was able to figure out quite quickly and fix. Also there were some performance issues with drawing the complex widgets and calculating how wide and high each tag widget has to be, to accommodate the text and that little close button (which is actually a label, not an actual button).

The tag list widget is based on a flow canvas, which is itself custom.

I improved the reflow further, by debouncing unnecessary configure events and only reflowing at most every `x` milliseconds, where `x` can be passed to the constructor. Currently for the tag list widget, the reflowing is set to happen with a debounce of 50ms.

#python #tkinter #gui #xiaolongdictionary #canvas #programming #coding