import iup
proc click(ih:PIhandle):cint {.cdecl.}=
return IUP_DEFAULT
proc button_cb(ih:PIhandle,button,pressed,x,y:cint,status:cstring):cint {.cdecl.}=
setAttribute(ih,"TITLE","button_cb")
return IUP_DEFAULT
discard iup.open(nil,nil)
var btn=iup.button("Hello!",nil)
discard setCallback(btn,"ACTION",click)
#THIS IS THE PROBLEM LINE THAT DONT COMPILE
#BECAUSE BUTTON_CB HAS THE WRONG PROTO:
discard setCallback(btn,"BUTTON_CB",castICallback)
setAttribute(btn,"RASTERSIZE","200x200")
var d=iup.dialog(btn)
discard d.show()
discard mainloop()
seem Nim try to load a specific release iup(30|27|26|25|24).dll and you have iup.dll
try to rename iup.dll to iup30.dll ?
Hello,
changing the source to (|30|27|26|25|24) should also work, if the DLL is iup.dll
@fakoli
I am not the author nor the maintainer for the tutorial so can't help here
but I have wrote, only for my own learn of Nim and nothing else, my own IUP little binding with very a limited demo. Don't know if it work on windows (I am on Linux/64).
https://github.com/nodrygo/NimIUPDemo
@enurlyx
You are right the demo code should be update with (|30|27|26|25|24)