I see in the GTK examples, there's a call to "nim_init" (btw, most of the examples still use "nimrod_init" which is deprecated). Where is this procedure from? I can't find it in either the Gtk or the Nim repository.
Is there a way in Nim to print out which module a procedure comes from?
Okay, so I found it in gtk2.nim. It seems that github has problems indexing that file for some reason.
But I'm still wondering about my second question.
GTK examples, there's a call to "nim_init"
Yes, that is a strange term. GTK lib needs initialization, so when using GTK from C, we call gtk_init(). Some people seems to have mapped that to nim_init for GTK2, and I think I have adopted that term for GTK3. Generally, for high level languages like Python or Ruby we do not call gtk_init() in our application. When I started with Nim GTK I asked if we can call gtk_init directly from the wrapper module, but there was no reply. It worked, I tested it, but I changed it back. There may be an advantage calling it manually? The problem is, thee is already some Nim GTK code, for example Aporia. And if I change too much, people may be afraid and avoid GTK3 completely.
Is there a way in Nim to print out which module a procedure comes from?
Yes indeed via nimsuggest or any editor that supports nimsuggest.
When I started with Nim GTK I asked if we can call gtk_init directly from the wrapper module, but there was no reply.
Sorry about that. Yes you can and should do that. Just provide a .deprecated dummy nim_init for GTK-3 that's a nop (empty discard body).