Re: Extending objects and initialization

2017-06-03 Thread Stefan_Salewski
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)

Re: Difficulty writing wrapper using FFI

2017-06-03 Thread Stefan_Salewski
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

Re: Proxy difficulties

2017-06-03 Thread dom96
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 Visual Studio Code to configure NIM quickly

2017-06-03 Thread testcrack
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)

Re: Difficulty writing wrapper using FFI

2017-06-03 Thread Stefan_Salewski
> 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

Re: Nim 1.0 ?

2017-06-03 Thread Arrrrrrrrr
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).

Re: Specify directory for binary

2017-06-03 Thread void_sleepy_bear
Thanks jcosborn! that worked for me. it makes sense now.

Re: Specify directory for binary

2017-06-03 Thread jcosborn
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

Re: Difficulty writing wrapper using FFI

2017-06-03 Thread cmacmackin
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

Re: Extending objects and initialization

2017-06-03 Thread mashingan
@Stefan_Salewski, it's called as UFCS.

Re: AsyncResponse body parsed to html cannot findAll a tag

2017-06-03 Thread mashingan
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

Re: asyncdispatch compiled with --threads:on

2017-06-03 Thread dom96
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)