Blog

The missing link

Two Windows 11 machines shared a Desktop folder under OneDrive. A couple of the Shortcut files in the folder, valid links to applications, were missing their icons. The problem was fixed by forcing the rebuilding the icon cache. Rebuilding the icon cache The rebuilding of the icon cache can be forced, as follows (in PowerShell): […]

Early Cabal

Michael Snoyman has tracked GHC and Cabal versions from GHC 7.8.3 and Cabal-1.18.1.3. I wanted to understand earlier versions of Cabal, from Cabal-1.0 up to the release of the ubiquitous cabal-version: >=1.10. Prehistory On 15 July 2003, Isaac Jones (as he then was) announced at libraries@haskell.org a Haskell-based build and install system, part of the […]

Haskell, GTK4 and list views

As a digression to my experiments with GTK4 and Haskell, inspired by a question at the Haskell Community, I looked at list views. A list view brings together a selection model and a list item factory. A selection model adds support for selection to a list model. A list item factory creates widgets for the […]

Haskell, GTK4 and printing

Another part of my experiments with GTK4 and Haskell was to investigate printing. That brought in the Cairo, Pango and PangoCairo C libraries, and the gi-cairo, gi-cairo-render, gi-cairo-connector, gi-pango, and gi-pangocairo Haskell packages. PrintOperation At the heart was to create a value of type PrintOperation, specifying its nPages and unit attributes and its handler of […]

Haskell, GTK4 and small pictures

I discovered that, with GTK4, when a vertical Box contains a Picture, and the width of the box is greater than that of the picture, the height of the box is set to maintain an aspect ratio that is the same as the picture’s: I wanted to avoid that behaviour. Horizontal box The solution was […]

Haskell, GTK4 and Hashi

My experiments with Haskell and GTK4 were heading towards something concrete, namely a GUI for a solver of Hashi puzzles. I had previously found Harald Bögeholz’s 2013 [open-source solver](https://github.com/ctbo/hashi) and forked it to create a command line application. hashi-solver.exe With a GUI application, it is perhaps easiest to start the journey with the destination: The […]

Haskell, GTK4 and pictures on the fly

As part of my further experiments with GTK4 and Haskell, I wanted to vary gtk-picture by creating the Picture programatically. I named the alternative gtk-dynamic-picture. Diagrams I created the picture using the Diagrams project. I looked at various backends that support that project: Ultimately, given the pixel format of a Pixbuf value (R G B […]

Haskell, GTK4 and application icons

On Windows 11, in File Explorer, gtk-picture.exe has Windows’ default icon for an executable file and GTK4’s default icon in the task bar when running: I wanted to customise these icons. Also, I wanted a similar icon to appear in the application’s window’s header bar, to the left. *.res file The icon can be set […]

Haskell, GTK4 and pictures

As part of my experiments with GTK4 and Haskell, I sought an application with a picture which would report on the co-ordinates if clicked on with a mouse. For my example image, I took the Flammarion wood engraving. gtk-picture With Stack, I created a new single-package project gtk-picture with Main.hs: and package.yaml (extract): and Stack […]

Haskell and GUI revisited

It had been over two years since I last looked at them, but I returned to Haskell, GUI and GTK4 on Windows. This time, things were more straightforward. To set things up again, I added the following MSYS2 packages to the Stack-supplied MSYS2 with stack exec — pacman -S: and set PKG_CONFIG_PATH to the mingw64\lib\pkgconfig […]