I still need to study some aspects of GTK, but tonight I wanted to place a small code base. In this case is not about the GUI, but about the core of the program! I’ve got:
- A simple configuration class (a few lines of Python and here we go!)
- GUI selection is configurable (which means that the software is not strictly bound to GTK: different toolkit could be added in future, allowing (for instance) to run seamlessly the stuff under a QT-based environment;
- Paragraph and Text Block abstractions (i.e. something like an intermediate representation of the text format which an be conveniently translated in Markdown.
I was thinking that, as there’s can be multiple choice in terms of GUI, there could be also room for different output formats besides Markdown. No, I don’t want to end with yet another word processor! The first rule here is simplicity! I’m just saying that Markdown has got many siblings…
Enough for today.
Unfortunately (well, also reasonably) the tutorial doesn’t give much complete documentation nor details about how everything works. However important information can just be obtained from the GTK C reference manual.
After playing with the Multiline Text Editor example, I started wondering how to save stuff and read formatting information. The documentation about the GtkTextIter component answered my first question, but I need to conceive a good way of retrieving the tags. Nothing I can’t handle.
NoteDown will be written in Python 3, since it fosters a rapid development, and I think it’s very neat. As for the graphical interface, I gave a glance at PyQt, Python TkInter and GTK3, and the latter seems the one which better suits my needs (at least, for the python bindings): simple, pythonic and and aesthetically good.
Despite I had some experience with GUI-based programming (using QT4 in C++) I’m pretty new with GTK, so I needed a tutorial, and I’ve found this one!