And to give you a starting point, the basic shape of your above program would look like this: import gintro/[gtk, gobject, gio] type Header = ref object of Headerbar text: string MainWindow = ref object of gtk.ApplicationWindow header: Header pb: ProgressBar proc newHeader(): Header = result = newHeaderbar(Header) result.text = "Initial Title" result.setTitle("Title") discard result.showCloseButton proc newMainWindow(gtkApplication: Application): MainWindow = result = newApplicationWindow(MainWindow, gtkApplication) result.header = newHeader() result.pb = newProgressBar() result.add(result.pb) result.pb.setFraction(0.25) result.setSizeRequest(400, 400) result.setTitlebar(result.header) result.showAll() proc appActivate(app: Application) = let window = newMainWindow(app) proc main = let app = newApplication("org.gtk.example") connect(app, "activate", appActivate) discard run(app) main() Run
For me it compiles and runs, but I think it does not look like you intend. I can not really test it as my current gintro is modified for my GTK4 experiments. Hopy you can tune it yourself.