Plumbering

If someone is reading this blog, sorry for being not that active in the last week. The issue here it’s that I’m also working on my master thesis, so from time to time I’ll be simply busy.

Fortunately (or unfortunatey, depending on the point of view), for the moment I’m waiting for my contacts. Free time. Let’s work on this project (for which I decide what to do).

No answer to my question, so I guess I’ll go on keeping my current code, with redundant signals fooling around my application. Maybe I’ll directly write to developers. Not today.

I’ll be working on the plumber-side of the application: markdown encoding.

First working GUI prototype

In the last two days I’ve written a working prototype of the main window that will compose NoteDown. It can be found in the git repository. Supported operations:

  • Text insertion (well, no big issue here, GTK takes care of that);
  • Bold/Italic/anything on selections (still no big issue, the Tutorial covers that);
  • Bold/Italic/anything on current word (zim-style)
  • Least astonishment behavior for Toggle-Buttons in the Toolbar

First code

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.

Playing with GTK

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.

Let’s start

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!