How to build an image viewer using Rust, gtk-rs, GTK4

Build Lookglass, a desktop image viewer with folder browse, zoom, slideshow, and packaging notes with Rust, gtk-rs, GTK4.

  • Difficulty Intermediate
  • Parts 12
  • Stack Rust, gtk-rs, GTK4

What you are building

Lookglass is a image viewer you assemble in twelve short stages. The teaching stack is gtk-rs (Rust, gtk-rs, GTK4). By the end you should understand the shell, the data you persist, and the everyday workflows people expect from this kind of app.

gtk-rs binds GTK4 for Rust. An image viewer teaches file choosers, pixbufs/textures, and keyboard navigation.

Show one image at a time with next/previous. Keep the directory listing separate from the display widget.

Work in order. Early folders are intentionally small so you can see the window (or server) boot before features pile on. From the data-layer part onward, each snapshot should still run after you install dependencies.

How to use these lessons

Read the goal, clone the matching GitHub folder, run it, then skim the code against the notes below. If something fails, fix the run path first—most “bugs” on day one are the wrong directory or a skipped install.

Open the Lookglass GitHub repo →

Parts in order

Each chapter below is one checkpoint. Open a part when you are ready for that feature—not all at once.