# \[ANN\] LibreRef - LablGtk-based Digital Reference Tool Application

**URL:** <https://discuss.ocaml.org/t/ann-libreref-lablgtk-based-digital-reference-tool-application/8077>\
**Category:** Community\
**Tags:** announce\
**Created:** [June 30, 2021, 2:06pm UTC](https://discuss.ocaml.org/t/ann-libreref-lablgtk-based-digital-reference-tool-application/8077 "2021-06-30T14:06:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Gopiandcode](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/gopiandcode/32/5346_2.png) [@Gopiandcode](https://discuss.ocaml.org/u/Gopiandcode)\
**Post date:** [June 30, 2021, 2:06pm UTC](https://discuss.ocaml.org/t/ann-libreref-lablgtk-based-digital-reference-tool-application/8077/1 "2021-06-30T14:06:06Z")

</div>

Hi all,

I’m not sure if this is that close to the typical uses of OCaml, but posting this here just in case anyone was interested in another end-user facing application using LablGtk.

 ![libre-ref-logo](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/b/b72b4bd7838e41dbaed2254350799c5e75245a3d.png)

> LibreRef is a free as in freedom digital referencing tool for artists.

It’s written in OCaml using LablGtk and Cairo to implement the GUI.

You can find the source code at: [gitlab](https://gitlab.com/gopiandcode/libre-ref) ([github mirror](https://github.com/Gopiandcode/LibreRef))

A picture is worth a thousand words, so before I continue, here are a few examples of it in action:

![paste_from_online](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/1/126997c61b83b700feac41e380b42c560bdf2340.gif)  
 ![resizing_and_multiple](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/4/49b11ef943e491ba220332d257bc6a15b506ed6b.gif)

Overall, getting LablGtk to work was fairly straightforward, although the documentation was a bit lacking (although the same might be said of Gtk itself).

I was able to piece together the correct uses of most of the API calls by relying on either the examples from the repository or by translating snippets of code from online back into LablGtk.

As for deploying it as an application, I found the AppImage & LinuxDeploy toolchain to work well with the resulting binary (admittedly I’ve only tested it with two devices so far), and it meant that I could publish the program without having to ask people to setup the full OCaml & Opam toolchain, which would probably be a large ask.

As for the implementation, I think it was fairly elegant (if I say so myself 🙂), although I may have gone overboard with functors (see this higher-order functor in the GUI interface: [gui.mli · master · Kiran Gopinathan / libre-ref · GitLab](https://gitlab.com/gopiandcode/libre-ref/-/blob/master/gui.mli#L175)) and some aspects of the separation of concerns weren’t so well established.

---

_[View the full topic](https://discuss.ocaml.org/t/ann-libreref-lablgtk-based-digital-reference-tool-application/8077)._
