Okay I worked my way somewhat through emit.

So I basically need these 2 expressions of sorts:

  1. Import whatever header file contains that function-like macro
  2. Call it



Now my main problem is just figuring out the precise syntax for both.
    
    
    proc getWidget*(builder: Builder, id: string): GtkWidget =
      let gObj: pointer = gtk_builder_get_object(builder.gtk, id.cstring)
      {.emit: "#include <gtk/gtk.h>".}
      {.emit: ["GTK_WIDGET (", gObj, ");"].}
      return GtkWidget(gObj)
    
    
    Run

Isn't doing it, and neither is using ` {.emit: "#include <gtk/gtkwidget.h>".} 
instead =/

Reply via email to