User avatar
PeterO
Posts: 5951
Joined: Sun Jul 22, 2012 4:14 pm

A little Gtk/Glade example

Fri Oct 21, 2016 4:08 pm

I wanted a nice big virtual 7 segment for one of my projects, so along the way I've knocked up this simple clock.
Image

Source code and glade file can be found in http://www.peteronion.org.uk/GtkClock/

You'll need libgtk-3-dev package installed to compile the code.
If you want to look at the ".glade" GUI definition file you'll need to install glade

If you know how to use cmake I've included a CMakeLists.txt
Otherwise compile with "gcc -Wall -Wextra -o Clock Clock.c $(pkg-config --cflags --libs gtk+-3.0) -export-dynamic"

Enjoy.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Return to “Graphics programming”