Written by Dominik Joe Pantůček on January 31, 2019.
It has been quite some time since we have discussed some interesting programming stuff we are doing here at Trustica. And – as you may have guessed – we have encountered quite a few things that needed to be done and apparently no-one has done them before. Read on to see how you can style UI elements in Racket.
Racket is a powerful Scheme-derived language that includes a plethora of utility libraries out of box. One of these libraries – it is better to say: collections – allows you to quickly develop a cross-platform UI applications. It has been a few years now since we started using it for most of our back-end and support GUI software.
Firstly we get a reference to the font structure using a global font list object and secondly we tell the button widget to use it. Trouble is the button widget ignores the font we pass it.
As you can see, it passes on everything as is to the underlying button% class but in case of text label, it is pre-rendered onto a bitmap canvas. This is actually just a sample code from StackOverflow extended to allow not only color change but also customizing the font.
And as you can see in Picture 1 below, the result looks pretty neat!
Once again we have proved that Racket is extremely flexible tool – even if you want to do relatively simple things. One can only guess why there are not more people programming in this Scheme-based language.
Hope you share our excitement about the tools we use and stay tuned for more information about Cryptoucan™ soon!