At first we do not create a full fledged application with all flags and whistles. Extensions to this program can easily be done by looking into other examples or tutorials to add e.g. a menu or dialogs. Note that you can download the source code from the introduction page.
Lets make a list first of what we want to accomplish for our prototype;
TODO
, DOING
, DONE
, PLANNING
, FIXME
, ARCHIVE
, HACK
, CHANGED
, XXX
, IDEA
, NOTE
and REVIEW
. You see that this program will handle more than only ‘todo’ lines!Store the results in an array of arrays. Each entry is an array holding the following marker information: [ <marker-name>, <line-number>, <marker-text> ]
;
Show the name of the file and the number of todo texts in a Gnome::Gtk3::TreeView.
When the line is (double) clicked, a list of todo texts and the line numbers where the text is found, appears in another list next to the TreeView.
Now that we have set our goals, we need to set up the working directory amongst other things;
todo-viewer
. In that directory we create the directories bin
, lib
and t
. The program will go to bin
and any module will go to lib
. The program is named todo-viewer.pl6
and the modules Gui.pm6
, SkimFile.pm6
and GuiHandlers.pm6
.MAIN()
in the program to get some arguments from the commandline. Also the main program will load some modules to handle the file I/O and building the graphical user interface (GUI). Also, we need a module to handle the signals. This will be loaded by the GUI module.my-test.pl6
. This file is placed in t/data
.