Pashua 0.10 released
Today, Pashua 0.10 was released (download). In addition to the usual fixes (wich can, as always, be found in the version history), there is a new feature which is worth mentioning and a change in how the example/binding code for Pashua is handled and distributed.
The new feature is the ability to declare elements as mandatory. Using this is as simple as adding
fieldname.mandatory = 1 to the window configuration. When the window is about to be closed using the default button and there are any elements that are defined as mandatory, but are empty, the window will not close, but instead the mandatory elements are highlighted. For a mandatory element, “empty” means that the element does not have a string value or that the string value contains only whitespace. The digit zero (0) is not regarded as empty. Radio buttons are regarded as empty as long as none of the buttons has been clicked.
mandatory attribute is not available for all elements, as there are types for which this simply does not make sense, for example all kinds of buttons.
The “Pashua bindings” repository
While in the past, example code for a whole bunch of supported languages was included in the download, I increasingly had the feeling that for a number of reasons this is not the proper way to handle it:
- When bundling the examples with Pashua, it is impossible to release updates to example code or examples for new languages independently from Pashua.
- The examples shipped with Pashua are not the “best” way to handle the communication with Pashua, but only one out of several possible ways. (The one which causes the least possible amount of maintenance work for me.) For instance, instead of defining a string which describes the window, one could of course also write example/binding code which follows a “GUI builder style”, offering an API which allows to invoke methods such as
$window->addTextfield(). So, instead of one example per language, it could easily become two or three examples, which is just too much to include it all.
- I am not an expert for all of the languages for which example code exists, so I should not be the one who is in charge of deciding if code is suitable to ship it with Pashua. This is also why a few times in the past I rejected code people sent me in languages I have never used (I recall that Ada95 and OCaml were such cases).
For all these reasons, I decided to move all existing examples/bindings to GitHub repositories (each in its own repository) and to start another repository (you could call it a meta repository) which contains nothing but a list of examples/bindings with links to the repositories. This repository is called ”Pashua bindings” and can be found at https://github.com/BlueM/Pashua-Bindings.
Currently, it lists only the examples which were distributed with Pashua 0.9.5.1 and the ones included in the new 0.10 release. But I hope that in the long run, I will get pull requests to include other examples/bindings in the list.