I just tried my initial idea, and indeed it seems to work not bad.
proc gtk_button_new*(): ptr Button00 {.
importc: "gtk_button_new", libprag.}
proc newButton*(): Button =
new(result, finalizeGObject)
result.impl = gtk_button_new()
GC_ref(result)
What you can do is of course to inspect the generated C sources in nimcache
directory. As you seems not to have crashes, I assume that your library is
loaded successfully, and that your functions are basically called correctly. So
problem may be just passing of parameters, and so comparing Nim
My guess is that this is an SSL issue, perhaps with your proxy? Maybe you could
check whether it works in Python?
How to use VScod to configure NIM quickly
[https://ooo.0o0.ooo/2017/06/03/593299cc93ebb.jpg](https://ooo.0o0.ooo/2017/06/03/593299cc93ebb.jpg)
> tried it, but it did not fix the problem.
Yes, it was only a guess. What is special in your code is, that you are working
with value types, while most C libs I am aware of are using pointers. If the C
lib really want to use value types, it may still be a problem how Nim compiler
pass value
No one knows for sure. But latest releases had 1.0 in mind. On the other hand,
you can check what is left before 1.0
[https://github.com/nim-lang/Nim/blob/devel/todo.txt#L1-L10](https://github.com/nim-lang/Nim/blob/devel/todo.txt#L1-L10).
Thanks jcosborn! that worked for me. it makes sense now.
You need to put the compiler arguments before the source file otherwise it
takes them to be arguments to the binary for the run command. This should work
nim --run c -o:../bin/program main.nim
Thanks for the suggestion. I tried it, but it did not fix the problem. I did
use c2nim for the bindings, but it didn't seem to know what to use for
uintptr_t. I thought I'd come across a wrapper somewhere which had used cint,
but I might be mis-remembering. As you can see, I have renamed the
@Stefan_Salewski, it's called as UFCS.
Sorry, I didn't recheck the posted code above, there were typos because I
didn't copied directly from the problem I wanted to solved. It's fixed now.
I think I misunderstood the `cb` in `callback` argument. I thought it didn't
return any value since the manual didn't state it but before I put
Seems like a regression, are you using Nim 0.17.0? If so, please report this on
[GitHub](https://github.com/nim-lang/Nim/issues)
12 matches
Mail list logo