Skip to content

pygtk-jsonview widget Modules

Recently, I have been giving some more thought to the TCG deck-editing program I started on last year. While I didn’t finish it at the time, I made some notes laying the groundwork for a more extensible framework that could be used across other projects. I don’t much like making posts about a project before it is complete, but I’m getting over it.

Today I committed an update to my Github repository, pygtk-jsonview. This repository is for modules to be used in database-editing and viewing programs where the developer may want to display data in a table, filter the displayed data, and display detailed information about selected rows of the table. Since each of those things requires access to the same data and formatting information, it makes sense for them all to be bundled in one module.

Following that, there are some basic widgets that one would use in those types of programs that are not represented in the base GTK widgets, since they are essentially constructed from the primitive widget set. I am also creating a separate module for these less primitive widgets so that they can be reused in other programs.

The first one that I approached was the Checklist widget, which appears like if a RadioButton widget was multiply selectable, and would be instantiated like this:

checklist = Checklist(choices = {'Label to display': 'name_to_compare_to_data', 'Second Label': 'second'})

Additionally, the Checklist functionality is inherited by a BooleanChecklist class, which is simply the Checklist if the choices were “True” or “False” and the data values were boolean (in the picture, “eatspoop” is a BooleanChecklist while “class” is a regular checklist).

The goal of this project is to make churning out database views for Python GTK programs exceedingly simple so that this complicated but common functionality can be implemented in new programs quickly. At the moment, the extent of the code is to produce the widgets that are displayed in the image above, but the functionality of the widgets is not developed. I will post more as the project develops.