Author Topic: RaspberryBASIC.org Forum  (Read 99933 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #210 on: December 23, 2019, 07:02:04 AM »
AIR,

I think the way to go with the SBT extension module I'm converting to a generic embeddable ScriptBasic interface is pass and return pData structures. This is all well and fine for C as the host but Nim is my target. Do you think Nim can handle working with this structure?

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #211 on: December 23, 2019, 01:01:45 PM »
The Nim IUP extension seems to only cover the IUP part of the library set and CD / IM are missing. At lease I have a model to work with to add the others.

NIUP includes the procs for IUP, CD and IM, don't use the plain IUP nimble package if you need CD and IM...

nimble install niup, then import niup

https://github.com/dariolah/niup

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #212 on: December 23, 2019, 01:14:48 PM »
I couldn't get it to work but I'll give niup another try now that the iup version works.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #213 on: December 24, 2019, 12:12:54 AM »
This is the problem I ran into last time with niup.

Code: Text
  1. import niup
  2. import niupext
  3.  
  4. proc btn_exit_cb(ih:PIhandle):cint {.cdecl.}=
  5.   # Exits the main loop
  6.   return IUP_CLOSE
  7.  
  8. proc mainProc =
  9.   var dlg, button, label, vbox: PIhandle
  10.  
  11.   Open()
  12.  
  13.   label =  Label("Hello world from IUP.")
  14.   button = Button("OK", nil)
  15.  
  16.   vbox = Vbox(label, button, nil)
  17.   withPIhandle vbox:
  18.     "ALIGNMENT" "ACENTER"
  19.     "GAP"       "10"
  20.     "MARGIN"    "10x10"
  21.  
  22.   dlg = Dialog(vbox)
  23.   SetAttribute(dlg, "TITLE", "Hello World with callback")
  24.  
  25.   # Registers callbacks
  26.   SetCallback(button, "ACTION", btn_exit_cb)
  27.  
  28.   ShowXY(dlg, IUP_CENTER, IUP_CENTER)
  29.  
  30.   MainLoop()
  31.  
  32.   Close()
  33.  
  34. if isMainModule:
  35.   mainProc()
  36.  


ubuntu@rpi4b:~/repo/Nim/examples/niup-dev$ nim c -d:release hello_iup.nim
Hint: used config file '/home/ubuntu/repo/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/ubuntu/repo/Nim/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: hello_iup [Processing]
Hint: niup [Processing]
fatal.nim(39)            sysFatal
Error: unhandled exception: 'ident' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]
ubuntu@rpi4b:~/repo/Nim/examples/niup-dev$


Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #214 on: December 24, 2019, 08:07:15 AM »
Best guess is the use of 'Close()' in the code.

What happens if you change it to 'niup.Close()' ?

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #215 on: December 24, 2019, 10:47:59 AM »
The example I used was from the niup site. One would think it should work.

Check out RB as I posted a more direct approach which sort of like DECLARE in ScriptBasic.

My Nim in Action book arrived today.
« Last Edit: December 24, 2019, 11:52:01 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #216 on: December 24, 2019, 02:13:30 PM »
There is something going wrong in the initialization of niup.

Code: Text
  1. import niup
  2.  
  3. echo "Got Here!"
  4.  


ubuntu@rpi4b:~/repo/Nim/examples$ nim c -d:release testniup.nim
Hint: used config file '/home/ubuntu/repo/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/ubuntu/repo/Nim/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: testniup [Processing]
Hint: niup [Processing]
fatal.nim(39)            sysFatal
Error: unhandled exception: 'ident' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]
ubuntu@rpi4b:~/repo/Nim/examples$


Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #217 on: December 24, 2019, 02:48:29 PM »
I was able to include most of the IUP section of the niup interface file and got it to work. Who knows when this interface was done and is  it compatible with the current release of IUP?

iup.nim (my test include)
Code: Text
  1. #Lib IUP
  2.  
  3. const
  4.   IUP_NAME* = "IUP - Portable User Interface"
  5.   IUP_DESCRIPTION* = "Multi-platform Toolkit for Building Graphical User Interfaces"
  6.   IUP_COPYRIGHT* = "Copyright (C) 1994-2019 Tecgraf/PUC-Rio"
  7.  
  8.   libiupSONAME = "libiup.so"
  9.   libiupcdSONAME = "libiupcd.so"
  10.   libcdSONAME = "libcd.so"
  11.   libiupcontrolsSONAME = "libiupcontrols.so"
  12.   libiupglcontrolsSONAME = "libiupglcontrols.so"
  13.   libiupglSONAME = "libiupgl.so"
  14.   libiupimglibSONAME = "libiupimglib.so"
  15.   libiupimSONAME = "libiupim.so"
  16.   libiup_mglplotSONAME = "libiup_mglplot.so"
  17.   libiup_plotSONAME = "libiup_plot.so"
  18.   libiup_scintillaSONAME = "libiup_scintilla.so"
  19.   libiuptuioSONAME = "libiuptuio.so"
  20.   libiupwebSONAME = "libiupweb.so"
  21.  
  22.  
  23.   IUP_ERROR* = 1
  24.   IUP_NOERROR* = 0
  25.   IUP_OPENED* = -1
  26.   IUP_INVALID* = -1
  27.   IUP_INVALID_ID* = -10
  28.   IUP_IGNORE* = -1
  29.   IUP_DEFAULT* = -2
  30.   IUP_CLOSE* = -3
  31.   IUP_CONTINUE* = -4
  32.   IUP_CENTER* = cint(0x0000FFFF)
  33.   IUP_LEFT* = cint(0x0000FFFE)
  34.   IUP_RIGHT* = cint(0x0000FFFD)
  35.   IUP_MOUSEPOS* = cint(0x0000FFFC)
  36.   IUP_CURRENT* = cint(0x0000FFFB)
  37.   IUP_CENTERPARENT* = cint(0x0000FFFA)
  38.   IUP_TOP* = IUP_LEFT
  39.   IUP_BOTTOM* = IUP_RIGHT
  40.  
  41.  
  42. type
  43.   Ihandle = object
  44.   PIhandle* = ptr Ihandle
  45.  
  46.   uptr_t = clong
  47.   sptr_t = clong
  48.   Icallback* = proc (a1: PIhandle): cint {.cdecl.}
  49.  
  50. proc Open*(argc: var cint; argv: ptr cstringArray): cint {.cdecl, importc: "IupOpen", dynlib: libiupSONAME, discardable.}
  51. proc Close*() {.cdecl, importc: "IupClose", dynlib: libiupSONAME.}
  52. proc IsOpened*(): cint {.cdecl, importc: "IupIsOpened", dynlib: libiupSONAME, discardable.}
  53. proc ImageLibOpen*() {.cdecl, importc: "IupImageLibOpen", dynlib: libiupimglibSONAME.}
  54. proc MainLoop*(): cint {.cdecl, importc: "IupMainLoop", dynlib: libiupSONAME, discardable.}
  55. proc LoopStep*(): cint {.cdecl, importc: "IupLoopStep", dynlib: libiupSONAME, discardable.}
  56. proc LoopStepWait*(): cint {.cdecl, importc: "IupLoopStepWait", dynlib: libiupSONAME, discardable.}
  57. proc MainLoopLevel*(): cint {.cdecl, importc: "IupMainLoopLevel", dynlib: libiupSONAME, discardable.}
  58. proc Flush*() {.cdecl, importc: "IupFlush", dynlib: libiupSONAME.}
  59. proc ExitLoop*() {.cdecl, importc: "IupExitLoop", dynlib: libiupSONAME.}
  60. proc PostMessage*(ih: PIhandle; s: cstring; i: cint; d: cdouble; p: pointer) {.cdecl, importc: "IupPostMessage", dynlib: libiupSONAME.}
  61. proc RecordInput*(filename: cstring; mode: cint): cint {.cdecl, importc: "IupRecordInput", dynlib: libiupSONAME, discardable.}
  62. proc PlayInput*(filename: cstring): cint {.cdecl, importc: "IupPlayInput", dynlib: libiupSONAME, discardable.}
  63. proc Update*(ih: PIhandle) {.cdecl, importc: "IupUpdate", dynlib: libiupSONAME.}
  64. proc UpdateChildren*(ih: PIhandle) {.cdecl, importc: "IupUpdateChildren", dynlib: libiupSONAME.}
  65. proc Redraw*(ih: PIhandle; children: cint) {.cdecl, importc: "IupRedraw", dynlib: libiupSONAME.}
  66. proc Refresh*(ih: PIhandle) {.cdecl, importc: "IupRefresh", dynlib: libiupSONAME.}
  67. proc RefreshChildren*(ih: PIhandle) {.cdecl, importc: "IupRefreshChildren", dynlib: libiupSONAME.}
  68. proc Execute*(filename: cstring; parameters: cstring): cint {.cdecl, importc: "IupExecute", dynlib: libiupSONAME, discardable.}
  69. proc ExecuteWait*(filename: cstring; parameters: cstring): cint {.cdecl, importc: "IupExecuteWait", dynlib: libiupSONAME, discardable.}
  70. proc Help*(url: cstring): cint {.cdecl, importc: "IupHelp", dynlib: libiupSONAME, discardable.}
  71. proc Log*(`type`: cstring; format: cstring) {.varargs, cdecl, importc: "IupLog", dynlib: libiupSONAME.}
  72. proc Load*(filename: cstring): cstring {.cdecl, importc: "IupLoad", dynlib: libiupSONAME.}
  73. proc LoadBuffer*(buffer: cstring): cstring {.cdecl, importc: "IupLoadBuffer", dynlib: libiupSONAME.}
  74. proc Version*(): cstring {.cdecl, importc: "IupVersion", dynlib: libiupSONAME.}
  75. proc VersionDate*(): cstring {.cdecl, importc: "IupVersionDate", dynlib: libiupSONAME.}
  76. proc VersionNumber*(): cint {.cdecl, importc: "IupVersionNumber", dynlib: libiupSONAME, discardable.}
  77. proc VersionShow*() {.cdecl, importc: "IupVersionShow", dynlib: libiupSONAME.}
  78. proc SetLanguage*(lng: cstring) {.cdecl, importc: "IupSetLanguage", dynlib: libiupSONAME.}
  79. proc GetLanguage*(): cstring {.cdecl, importc: "IupGetLanguage", dynlib: libiupSONAME.}
  80. proc SetLanguageString*(name: cstring; str: cstring) {.cdecl, importc: "IupSetLanguageString", dynlib: libiupSONAME.}
  81. proc StoreLanguageString*(name: cstring; str: cstring) {.cdecl, importc: "IupStoreLanguageString", dynlib: libiupSONAME.}
  82. proc GetLanguageString*(name: cstring): cstring {.cdecl, importc: "IupGetLanguageString", dynlib: libiupSONAME.}
  83. proc SetLanguagePack*(ih: PIhandle) {.cdecl, importc: "IupSetLanguagePack", dynlib: libiupSONAME.}
  84. proc Destroy*(ih: PIhandle) {.cdecl, importc: "IupDestroy", dynlib: libiupSONAME.}
  85. proc Detach*(child: PIhandle) {.cdecl, importc: "IupDetach", dynlib: libiupSONAME.}
  86. proc Append*(ih: PIhandle; child: PIhandle): PIhandle {.cdecl, importc: "IupAppend", dynlib: libiupSONAME.}
  87. proc Insert*(ih: PIhandle; ref_child: PIhandle; child: PIhandle): PIhandle {. cdecl, importc: "IupInsert", dynlib: libiupSONAME.}
  88. proc GetChild*(ih: PIhandle; pos: cint): PIhandle {.cdecl, importc: "IupGetChild", dynlib: libiupSONAME.}
  89. proc GetChildPos*(ih: PIhandle; child: PIhandle): cint {.cdecl, importc: "IupGetChildPos", dynlib: libiupSONAME, discardable.}
  90. proc GetChildCount*(ih: PIhandle): cint {.cdecl, importc: "IupGetChildCount", dynlib: libiupSONAME, discardable.}
  91. proc GetNextChild*(ih: PIhandle; child: PIhandle): PIhandle {.cdecl, importc: "IupGetNextChild", dynlib: libiupSONAME.}
  92. proc GetBrother*(ih: PIhandle): PIhandle {.cdecl, importc: "IupGetBrother", dynlib: libiupSONAME.}
  93. proc GetParent*(ih: PIhandle): PIhandle {.cdecl, importc: "IupGetParent", dynlib: libiupSONAME.}
  94. proc GetDialog*(ih: PIhandle): PIhandle {.cdecl, importc: "IupGetDialog", dynlib: libiupSONAME.}
  95. proc GetDialogChild*(ih: PIhandle; name: cstring): PIhandle {.cdecl, importc: "IupGetDialogChild", dynlib: libiupSONAME.}
  96. proc Reparent*(ih: PIhandle; new_parent: PIhandle; ref_child: PIhandle): cint {. cdecl, importc: "IupReparent", dynlib: libiupSONAME, discardable.}
  97. proc Popup*(ih: PIhandle; x: cint; y: cint): cint {.cdecl, importc: "IupPopup", dynlib: libiupSONAME, discardable.}
  98. proc Show*(ih: PIhandle): cint {.cdecl, importc: "IupShow", dynlib: libiupSONAME, discardable.}
  99. proc ShowXY*(ih: PIhandle; x: cint; y: cint): cint {.cdecl, importc: "IupShowXY", dynlib: libiupSONAME, discardable.}
  100. proc Hide*(ih: PIhandle): cint {.cdecl, importc: "IupHide", dynlib: libiupSONAME, discardable.}
  101. proc Map*(ih: PIhandle): cint {.cdecl, importc: "IupMap", dynlib: libiupSONAME, discardable.}
  102. proc Unmap*(ih: PIhandle) {.cdecl, importc: "IupUnmap", dynlib: libiupSONAME.}
  103. proc ResetAttribute*(ih: PIhandle; name: cstring) {.cdecl, importc: "IupResetAttribute", dynlib: libiupSONAME.}
  104. proc GetAllAttributes*(ih: PIhandle; names: cstringArray; n: cint): cint {.cdecl, importc: "IupGetAllAttributes", dynlib: libiupSONAME, discardable.}
  105. proc CopyAttributes*(src_ih: PIhandle; dst_ih: PIhandle) {.cdecl, importc: "IupCopyAttributes", dynlib: libiupSONAME.}
  106. proc SetAtt*(handle_name: cstring; ih: PIhandle; name: cstring): PIhandle {.varargs, cdecl, importc: "IupSetAtt", dynlib: libiupSONAME.}
  107. proc SetAttributes*(ih: PIhandle; str: cstring): PIhandle {.cdecl, importc: "IupSetAttributes", dynlib: libiupSONAME, discardable.}
  108. proc GetAttributes*(ih: PIhandle): cstring {.cdecl, importc: "IupGetAttributes", dynlib: libiupSONAME.}
  109. proc SetAttribute*(ih: PIhandle; name: cstring; value: cstring) {.cdecl, importc: "IupSetAttribute", dynlib: libiupSONAME.}
  110. proc SetStrAttribute*(ih: PIhandle; name: cstring; value: cstring) {.cdecl, importc: "IupSetStrAttribute", dynlib: libiupSONAME.}
  111. proc SetStrf*(ih: PIhandle; name: cstring; format: cstring) {.varargs, cdecl, importc: "IupSetStrf", dynlib: libiupSONAME.}
  112. proc SetInt*(ih: PIhandle; name: cstring; value: cint) {.cdecl, importc: "IupSetInt", dynlib: libiupSONAME.}
  113. proc SetFloat*(ih: PIhandle; name: cstring; value: cfloat) {.cdecl, importc: "IupSetFloat", dynlib: libiupSONAME.}
  114. proc SetDouble*(ih: PIhandle; name: cstring; value: cdouble) {.cdecl, importc: "IupSetDouble", dynlib: libiupSONAME.}
  115. proc SetRGB*(ih: PIhandle; name: cstring; r: cuchar; g: cuchar; b: cuchar) {.cdecl, importc: "IupSetRGB", dynlib: libiupSONAME.}
  116. proc GetAttribute*(ih: PIhandle; name: cstring): cstring {.cdecl, importc: "IupGetAttribute", dynlib: libiupSONAME.}
  117. proc GetInt*(ih: PIhandle; name: cstring): cint {.cdecl, importc: "IupGetInt", dynlib: libiupSONAME, discardable.}
  118. proc GetInt2*(ih: PIhandle; name: cstring): cint {.cdecl, importc: "IupGetInt2", dynlib: libiupSONAME, discardable.}
  119. proc GetIntInt*(ih: PIhandle; name: cstring; i1: var cint; i2: var cint): cint {.cdecl, importc: "IupGetIntInt", dynlib: libiupSONAME, discardable.}
  120. proc GetFloat*(ih: PIhandle; name: cstring): cfloat {.cdecl, importc: "IupGetFloat", dynlib: libiupSONAME.}
  121. proc GetDouble*(ih: PIhandle; name: cstring): cdouble {.cdecl, importc: "IupGetDouble", dynlib: libiupSONAME.}
  122. proc GetRGB*(ih: PIhandle; name: cstring; r: ptr cuchar; g: ptr cuchar; b: ptr cuchar) {. cdecl, importc: "IupGetRGB", dynlib: libiupSONAME.}
  123. proc SetAttributeId*(ih: PIhandle; name: cstring; id: cint; value: cstring) {.cdecl, importc: "IupSetAttributeId", dynlib: libiupSONAME.}
  124. proc SetStrAttributeId*(ih: PIhandle; name: cstring; id: cint; value: cstring) {.cdecl, importc: "IupSetStrAttributeId", dynlib: libiupSONAME.}
  125. proc SetStrfId*(ih: PIhandle; name: cstring; id: cint; format: cstring) {.varargs, cdecl, importc: "IupSetStrfId", dynlib: libiupSONAME.}
  126. proc SetIntId*(ih: PIhandle; name: cstring; id: cint; value: cint) {.cdecl, importc: "IupSetIntId", dynlib: libiupSONAME.}
  127. proc SetFloatId*(ih: PIhandle; name: cstring; id: cint; value: cfloat) {.cdecl, importc: "IupSetFloatId", dynlib: libiupSONAME.}
  128. proc SetDoubleId*(ih: PIhandle; name: cstring; id: cint; value: cdouble) {.cdecl, importc: "IupSetDoubleId", dynlib: libiupSONAME.}
  129. proc SetRGBId*(ih: PIhandle; name: cstring; id: cint; r: cuchar; g: cuchar; b: cuchar) {. cdecl, importc: "IupSetRGBId", dynlib: libiupSONAME.}
  130. proc GetAttributeId*(ih: PIhandle; name: cstring; id: cint): cstring {.cdecl, importc: "IupGetAttributeId", dynlib: libiupSONAME.}
  131. proc GetIntId*(ih: PIhandle; name: cstring; id: cint): cint {.cdecl, importc: "IupGetIntId", dynlib: libiupSONAME, discardable.}
  132. proc GetFloatId*(ih: PIhandle; name: cstring; id: cint): cfloat {.cdecl, importc: "IupGetFloatId", dynlib: libiupSONAME.}
  133. proc GetDoubleId*(ih: PIhandle; name: cstring; id: cint): cdouble {.cdecl, importc: "IupGetDoubleId", dynlib: libiupSONAME.}
  134. proc GetRGBId*(ih: PIhandle; name: cstring; id: cint; r: ptr cuchar; g: ptr cuchar; b: ptr cuchar) {.cdecl, importc: "IupGetRGBId", dynlib: libiupSONAME.}
  135. proc SetAttributeId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; value: cstring) {. cdecl, importc: "IupSetAttributeId2", dynlib: libiupSONAME.}
  136. proc SetStrAttributeId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; value: cstring) {.cdecl, importc: "IupSetStrAttributeId2", dynlib: libiupSONAME.}
  137. proc SetStrfId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; format: cstring) {. varargs, cdecl, importc: "IupSetStrfId2", dynlib: libiupSONAME.}
  138. proc SetIntId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; value: cint) {.cdecl, importc: "IupSetIntId2", dynlib: libiupSONAME.}
  139. proc SetFloatId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; value: cfloat) {. cdecl, importc: "IupSetFloatId2", dynlib: libiupSONAME.}
  140. proc SetDoubleId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; value: cdouble) {. cdecl, importc: "IupSetDoubleId2", dynlib: libiupSONAME.}
  141. proc SetRGBId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; r: cuchar; g: cuchar; b: cuchar) {.cdecl, importc: "IupSetRGBId2", dynlib: libiupSONAME.}
  142. proc GetAttributeId2*(ih: PIhandle; name: cstring; lin: cint; col: cint): cstring {. cdecl, importc: "IupGetAttributeId2", dynlib: libiupSONAME.}
  143. proc GetIntId2*(ih: PIhandle; name: cstring; lin: cint; col: cint): cint {.cdecl, importc: "IupGetIntId2", dynlib: libiupSONAME, discardable.}
  144. proc GetFloatId2*(ih: PIhandle; name: cstring; lin: cint; col: cint): cfloat {.cdecl, importc: "IupGetFloatId2", dynlib: libiupSONAME.}
  145. proc GetDoubleId2*(ih: PIhandle; name: cstring; lin: cint; col: cint): cdouble {.cdecl, importc: "IupGetDoubleId2", dynlib: libiupSONAME.}
  146. proc GetRGBId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; r: ptr cuchar; g: ptr cuchar; b: ptr cuchar) {.cdecl, importc: "IupGetRGBId2", dynlib: libiupSONAME.}
  147. proc SetGlobal*(name: cstring; value: cstring) {.cdecl, importc: "IupSetGlobal", dynlib: libiupSONAME.}
  148. proc SetStrGlobal*(name: cstring; value: cstring) {.cdecl, importc: "IupSetStrGlobal", dynlib: libiupSONAME.}
  149. proc GetGlobal*(name: cstring): cstring {.cdecl, importc: "IupGetGlobal", dynlib: libiupSONAME.}
  150. proc SetFocus*(ih: PIhandle): PIhandle {.cdecl, importc: "IupSetFocus", dynlib: libiupSONAME, discardable.}
  151. proc GetFocus*(): PIhandle {.cdecl, importc: "IupGetFocus", dynlib: libiupSONAME.}
  152. proc PreviousField*(ih: PIhandle): PIhandle {.cdecl, importc: "IupPreviousField", dynlib: libiupSONAME.}
  153. proc NextField*(ih: PIhandle): PIhandle {.cdecl, importc: "IupNextField", dynlib: libiupSONAME.}
  154. proc GetCallback*(ih: PIhandle; name: cstring): Icallback {.cdecl, importc: "IupGetCallback", dynlib: libiupSONAME.}
  155. proc SetCallback*(ih: PIhandle; name: cstring; `func`: Icallback): Icallback {.cdecl, importc: "IupSetCallback", dynlib: libiupSONAME, discardable.}
  156. proc SetCallbacks*(ih: PIhandle; name: cstring; `func`: Icallback): PIhandle {. varargs, cdecl, importc: "IupSetCallbacks", dynlib: libiupSONAME, discardable.}
  157. proc GetFunction*(name: cstring): Icallback {.cdecl, importc: "IupGetFunction", dynlib: libiupSONAME.}
  158. proc SetFunction*(name: cstring; `func`: Icallback): Icallback {.cdecl, importc: "IupSetFunction", dynlib: libiupSONAME.}
  159. proc GetHandle*(name: cstring): PIhandle {.cdecl, importc: "IupGetHandle", dynlib: libiupSONAME.}
  160. proc SetHandle*(name: cstring; ih: PIhandle): PIhandle {.cdecl, importc: "IupSetHandle", dynlib: libiupSONAME, discardable.}
  161. proc GetAllNames*(names: cstringArray; n: cint): cint {.cdecl, importc: "IupGetAllNames", dynlib: libiupSONAME, discardable.}
  162. proc GetAllDialogs*(names: cstringArray; n: cint): cint {.cdecl, importc: "IupGetAllDialogs", dynlib: libiupSONAME, discardable.}
  163. proc GetName*(ih: PIhandle): cstring {.cdecl, importc: "IupGetName", dynlib: libiupSONAME.}
  164. proc SetAttributeHandle*(ih: PIhandle; name: cstring; ih_named: PIhandle) {.cdecl, importc: "IupSetAttributeHandle", dynlib: libiupSONAME.}
  165. proc GetAttributeHandle*(ih: PIhandle; name: cstring): PIhandle {.cdecl, importc: "IupGetAttributeHandle", dynlib: libiupSONAME.}
  166. proc SetAttributeHandleId*(ih: PIhandle; name: cstring; id: cint; ih_named: PIhandle) {.cdecl, importc: "IupSetAttributeHandleId", dynlib: libiupSONAME.}
  167. proc GetAttributeHandleId*(ih: PIhandle; name: cstring; id: cint): PIhandle {.cdecl, importc: "IupGetAttributeHandleId", dynlib: libiupSONAME.}
  168. proc SetAttributeHandleId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; ih_named: PIhandle) {.cdecl, importc: "IupSetAttributeHandleId2", dynlib: libiupSONAME.}
  169. proc GetAttributeHandleId2*(ih: PIhandle; name: cstring; lin: cint; col: cint): PIhandle {. cdecl, importc: "IupGetAttributeHandleId2", dynlib: libiupSONAME.}
  170. proc GetClassName*(ih: PIhandle): cstring {.cdecl, importc: "IupGetClassName", dynlib: libiupSONAME.}
  171. proc GetClassType*(ih: PIhandle): cstring {.cdecl, importc: "IupGetClassType", dynlib: libiupSONAME.}
  172. proc GetAllClasses*(names: cstringArray; n: cint): cint {.cdecl, importc: "IupGetAllClasses", dynlib: libiupSONAME, discardable.}
  173. proc GetClassAttributes*(classname: cstring; names: cstringArray; n: cint): cint {. cdecl, importc: "IupGetClassAttributes", dynlib: libiupSONAME, discardable.}
  174. proc GetClassCallbacks*(classname: cstring; names: cstringArray; n: cint): cint {.cdecl, importc: "IupGetClassCallbacks", dynlib: libiupSONAME, discardable.}
  175. proc SaveClassAttributes*(ih: PIhandle) {.cdecl, importc: "IupSaveClassAttributes", dynlib: libiupSONAME.}
  176. proc CopyClassAttributes*(src_ih: PIhandle; dst_ih: PIhandle) {.cdecl, importc: "IupCopyClassAttributes", dynlib: libiupSONAME.}
  177. proc SetClassDefaultAttribute*(classname: cstring; name: cstring; value: cstring) {. cdecl, importc: "IupSetClassDefaultAttribute", dynlib: libiupSONAME.}
  178. proc ClassMatch*(ih: PIhandle; classname: cstring): cint {.cdecl, importc: "IupClassMatch", dynlib: libiupSONAME, discardable.}
  179. proc Create*(classname: cstring): PIhandle {.cdecl, importc: "IupCreate", dynlib: libiupSONAME.}
  180. proc Createv*(classname: cstring; params: ptr pointer): PIhandle {.cdecl, importc: "IupCreatev", dynlib: libiupSONAME.}
  181. proc Createp*(classname: cstring; first: pointer): PIhandle {.varargs, cdecl, importc: "IupCreatep", dynlib: libiupSONAME.}
  182. proc Fill*(): PIhandle {.cdecl, importc: "IupFill", dynlib: libiupSONAME.}
  183. proc Space*(): PIhandle {.cdecl, importc: "IupSpace", dynlib: libiupSONAME.}
  184. proc Radio*(child: PIhandle): PIhandle {.cdecl, importc: "IupRadio", dynlib: libiupSONAME.}
  185. proc Vbox*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupVbox", dynlib: libiupSONAME.}
  186. proc Vboxv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupVboxv", dynlib: libiupSONAME.}
  187. proc Zbox*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupZbox", dynlib: libiupSONAME.}
  188. proc Zboxv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupZboxv", dynlib: libiupSONAME.}
  189. proc Hbox*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupHbox", dynlib: libiupSONAME.}
  190. proc Hboxv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupHboxv", dynlib: libiupSONAME.}
  191. proc Normalizer*(ih_first: PIhandle): PIhandle {.varargs, cdecl, importc: "IupNormalizer", dynlib: libiupSONAME.}
  192. proc Normalizerv*(ih_list: ptr PIhandle): PIhandle {.cdecl, importc: "IupNormalizerv", dynlib: libiupSONAME.}
  193. proc Cbox*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupCbox", dynlib: libiupSONAME.}
  194. proc Cboxv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupCboxv", dynlib: libiupSONAME.}
  195. proc Sbox*(child: PIhandle): PIhandle {.cdecl, importc: "IupSbox", dynlib: libiupSONAME.}
  196. proc Split*(child1: PIhandle; child2: PIhandle): PIhandle {.cdecl, importc: "IupSplit", dynlib: libiupSONAME.}
  197. proc ScrollBox*(child: PIhandle): PIhandle {.cdecl, importc: "IupScrollBox", dynlib: libiupSONAME.}
  198. proc FlatScrollBox*(child: PIhandle): PIhandle {.cdecl, importc: "IupFlatScrollBox", dynlib: libiupSONAME.}
  199. proc GridBox*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupGridBox", dynlib: libiupSONAME.}
  200. proc GridBoxv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupGridBoxv", dynlib: libiupSONAME.}
  201. proc MultiBox*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupMultiBox", dynlib: libiupSONAME.}
  202. proc MultiBoxv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupMultiBoxv", dynlib: libiupSONAME.}
  203. proc Expander*(child: PIhandle): PIhandle {.cdecl, importc: "IupExpander", dynlib: libiupSONAME.}
  204. proc DetachBox*(child: PIhandle): PIhandle {.cdecl, importc: "IupDetachBox", dynlib: libiupSONAME.}
  205. proc BackgroundBox*(child: PIhandle): PIhandle {.cdecl, importc: "IupBackgroundBox", dynlib: libiupSONAME.}
  206. proc Frame*(child: PIhandle): PIhandle {.cdecl, importc: "IupFrame", dynlib: libiupSONAME.}
  207. proc FlatFrame*(child: PIhandle): PIhandle {.cdecl, importc: "IupFlatFrame", dynlib: libiupSONAME.}
  208. proc Image*(width: cint; height: cint; pixels: ptr cuchar): PIhandle {.cdecl, importc: "IupImage", dynlib: libiupSONAME.}
  209. proc ImageRGB*(width: cint; height: cint; pixels: ptr cuchar): PIhandle {.cdecl, importc: "IupImageRGB", dynlib: libiupSONAME.}
  210. proc ImageRGBA*(width: cint; height: cint; pixels: ptr cuchar): PIhandle {.cdecl, importc: "IupImageRGBA", dynlib: libiupSONAME.}
  211. proc Item*(title: cstring; action: cstring): PIhandle {.cdecl, importc: "IupItem", dynlib: libiupSONAME.}
  212. proc Submenu*(title: cstring; child: PIhandle): PIhandle {.cdecl, importc: "IupSubmenu", dynlib: libiupSONAME.}
  213. proc Separator*(): PIhandle {.cdecl, importc: "IupSeparator", dynlib: libiupSONAME.}
  214. proc Menu*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupMenu", dynlib: libiupSONAME.}
  215. proc Menuv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupMenuv", dynlib: libiupSONAME.}
  216. proc Button*(title: cstring; action: cstring): PIhandle {.cdecl, importc: "IupButton", dynlib: libiupSONAME.}
  217. proc FlatButton*(title: cstring): PIhandle {.cdecl, importc: "IupFlatButton", dynlib: libiupSONAME.}
  218. proc FlatToggle*(title: cstring): PIhandle {.cdecl, importc: "IupFlatToggle", dynlib: libiupSONAME.}
  219. proc DropButton*(dropchild: PIhandle): PIhandle {.cdecl, importc: "IupDropButton", dynlib: libiupSONAME.}
  220. proc FlatLabel*(title: cstring): PIhandle {.cdecl, importc: "IupFlatLabel", dynlib: libiupSONAME.}
  221. proc FlatSeparator*(): PIhandle {.cdecl, importc: "IupFlatSeparator", dynlib: libiupSONAME.}
  222. proc Canvas*(action: cstring): PIhandle {.cdecl, importc: "IupCanvas", dynlib: libiupSONAME.}
  223. proc Dialog*(child: PIhandle): PIhandle {.cdecl, importc: "IupDialog", dynlib: libiupSONAME.}
  224. proc User*(): PIhandle {.cdecl, importc: "IupUser", dynlib: libiupSONAME.}
  225. proc Thread*(): PIhandle {.cdecl, importc: "IupThread", dynlib: libiupSONAME.}
  226. proc Label*(title: cstring): PIhandle {.cdecl, importc: "IupLabel", dynlib: libiupSONAME.}
  227. proc List*(action: cstring): PIhandle {.cdecl, importc: "IupList", dynlib: libiupSONAME.}
  228. proc FlatList*(): PIhandle {.cdecl, importc: "IupFlatList", dynlib: libiupSONAME.}
  229. proc Text*(action: cstring): PIhandle {.cdecl, importc: "IupText", dynlib: libiupSONAME.}
  230. proc MultiLine*(action: cstring): PIhandle {.cdecl, importc: "IupMultiLine", dynlib: libiupSONAME.}
  231. proc Toggle*(title: cstring; action: cstring): PIhandle {.cdecl, importc: "IupToggle", dynlib: libiupSONAME.}
  232. proc Timer*(): PIhandle {.cdecl, importc: "IupTimer", dynlib: libiupSONAME.}
  233. proc Clipboard*(): PIhandle {.cdecl, importc: "IupClipboard", dynlib: libiupSONAME.}
  234. proc ProgressBar*(): PIhandle {.cdecl, importc: "IupProgressBar", dynlib: libiupSONAME.}
  235. proc Val*(`type`: cstring): PIhandle {.cdecl, importc: "IupVal", dynlib: libiupSONAME.}
  236. proc FlatVal*(`type`: cstring): PIhandle {.cdecl, importc: "IupFlatVal", dynlib: libiupSONAME.}
  237. proc Tabs*(child: PIhandle): PIhandle {.varargs, cdecl, importc: "IupTabs", dynlib: libiupSONAME.}
  238. proc Tabsv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupTabsv", dynlib: libiupSONAME.}
  239. proc FlatTabs*(first: PIhandle): PIhandle {.varargs, cdecl, importc: "IupFlatTabs", dynlib: libiupSONAME.}
  240. proc FlatTabsv*(children: ptr PIhandle): PIhandle {.cdecl, importc: "IupFlatTabsv", dynlib: libiupSONAME.}
  241. proc Tree*(): PIhandle {.cdecl, importc: "IupTree", dynlib: libiupSONAME.}
  242. proc Link*(url: cstring; title: cstring): PIhandle {.cdecl, importc: "IupLink", dynlib: libiupSONAME.}
  243. proc AnimatedLabel*(animation: PIhandle): PIhandle {.cdecl, importc: "IupAnimatedLabel", dynlib: libiupSONAME.}
  244. proc DatePick*(): PIhandle {.cdecl, importc: "IupDatePick", dynlib: libiupSONAME.}
  245. proc Calendar*(): PIhandle {.cdecl, importc: "IupCalendar", dynlib: libiupSONAME.}
  246. proc Colorbar*(): PIhandle {.cdecl, importc: "IupColorbar", dynlib: libiupSONAME.}
  247. proc Gauge*(): PIhandle {.cdecl, importc: "IupGauge", dynlib: libiupSONAME.}
  248. proc Dial*(`type`: cstring): PIhandle {.cdecl, importc: "IupDial", dynlib: libiupSONAME.}
  249. proc ColorBrowser*(): PIhandle {.cdecl, importc: "IupColorBrowser", dynlib: libiupSONAME.}
  250. proc Spin*(): PIhandle {.cdecl, importc: "IupSpin", dynlib: libiupSONAME.}
  251. proc Spinbox*(child: PIhandle): PIhandle {.cdecl, importc: "IupSpinbox", dynlib: libiupSONAME.}
  252. proc StringCompare*(str1: cstring; str2: cstring; casesensitive: cint; lexicographic: cint): cint {.cdecl, importc: "IupStringCompare", dynlib: libiupSONAME, discardable.}
  253. proc SaveImageAsText*(ih: PIhandle; filename: cstring; format: cstring; name: cstring): cint {. cdecl, importc: "IupSaveImageAsText", dynlib: libiupimSONAME, discardable.}
  254. proc ImageGetHandle*(name: cstring): PIhandle {.cdecl, importc: "IupImageGetHandle", dynlib: libiupSONAME.}
  255. proc TextConvertLinColToPos*(ih: PIhandle; lin: cint; col: cint; pos: var cint) {.cdecl, importc: "IupTextConvertLinColToPos", dynlib: libiupSONAME.}
  256. proc TextConvertPosToLinCol*(ih: PIhandle; pos: cint; lin: var cint; col: var cint) {. cdecl, importc: "IupTextConvertPosToLinCol", dynlib: libiupSONAME.}
  257. proc ConvertXYToPos*(ih: PIhandle; x: cint; y: cint): cint {.cdecl, importc: "IupConvertXYToPos", dynlib: libiupSONAME, discardable.}
  258. proc StoreGlobal*(name: cstring; value: cstring) {.cdecl, importc: "IupStoreGlobal", dynlib: libiupSONAME.}
  259. proc StoreAttribute*(ih: PIhandle; name: cstring; value: cstring) {.cdecl, importc: "IupStoreAttribute", dynlib: libiupSONAME.}
  260. proc SetfAttribute*(ih: PIhandle; name: cstring; format: cstring) {.varargs, cdecl, importc: "IupSetfAttribute", dynlib: libiupSONAME.}
  261. proc StoreAttributeId*(ih: PIhandle; name: cstring; id: cint; value: cstring) {.cdecl, importc: "IupStoreAttributeId", dynlib: libiupSONAME.}
  262. proc SetfAttributeId*(ih: PIhandle; name: cstring; id: cint; f: cstring) {.varargs, cdecl, importc: "IupSetfAttributeId", dynlib: libiupSONAME.}
  263. proc StoreAttributeId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; value: cstring) {.cdecl, importc: "IupStoreAttributeId2", dynlib: libiupSONAME.}
  264. proc SetfAttributeId2*(ih: PIhandle; name: cstring; lin: cint; col: cint; format: cstring) {.varargs, cdecl, importc: "IupSetfAttributeId2", dynlib: libiupSONAME.}
  265. proc TreeSetUserId*(ih: PIhandle; id: cint; userid: pointer): cint {.cdecl, importc: "IupTreeSetUserId", dynlib: libiupSONAME, discardable.}
  266. proc TreeGetUserId*(ih: PIhandle; id: cint): pointer {.cdecl, importc: "IupTreeGetUserId", dynlib: libiupSONAME.}
  267. proc TreeGetId*(ih: PIhandle; userid: pointer): cint {.cdecl, importc: "IupTreeGetId", dynlib: libiupSONAME, discardable.}
  268. proc TreeSetAttributeHandle*(ih: PIhandle; name: cstring; id: cint; ih_named: PIhandle) {.cdecl, importc: "IupTreeSetAttributeHandle", dynlib: libiupSONAME.}
  269. proc FileDlg*(): PIhandle {.cdecl, importc: "IupFileDlg", dynlib: libiupSONAME.}
  270. proc MessageDlg*(): PIhandle {.cdecl, importc: "IupMessageDlg", dynlib: libiupSONAME.}
  271. proc ColorDlg*(): PIhandle {.cdecl, importc: "IupColorDlg", dynlib: libiupSONAME.}
  272. proc FontDlg*(): PIhandle {.cdecl, importc: "IupFontDlg", dynlib: libiupSONAME.}
  273. proc ProgressDlg*(): PIhandle {.cdecl, importc: "IupProgressDlg", dynlib: libiupSONAME.}
  274. proc GetFile*(arq: cstring): cint {.cdecl, importc: "IupGetFile", dynlib: libiupSONAME, discardable.}
  275. proc Message*(title: cstring; msg: cstring) {.cdecl, importc: "IupMessage", dynlib: libiupSONAME.}
  276. proc Messagef*(title: cstring; format: cstring) {.varargs, cdecl, importc: "IupMessagef", dynlib: libiupSONAME.}
  277. proc MessageError*(parent: PIhandle; message: cstring) {.cdecl, importc: "IupMessageError", dynlib: libiupSONAME.}
  278. proc MessageAlarm*(parent: PIhandle; title: cstring; message: cstring; buttons: cstring): cint {.cdecl, importc: "IupMessageAlarm", dynlib: libiupSONAME, discardable.}
  279. proc Alarm*(title: cstring; msg: cstring; b1: cstring; b2: cstring; b3: cstring): cint {. cdecl, importc: "IupAlarm", dynlib: libiupSONAME, discardable.}
  280. proc Scanf*(format: cstring): cint {.varargs, cdecl, importc: "IupScanf", dynlib: libiupSONAME, discardable.}
  281. proc ListDialog*(`type`: cint; title: cstring; size: cint; list: cstringArray; op: cint; max_col: cint; max_lin: cint; marks: var cint): cint {.cdecl, importc: "IupListDialog", dynlib: libiupSONAME, discardable.}
  282. proc GetText*(title: cstring; text: cstring; maxsize: cint): cint {.cdecl, importc: "IupGetText", dynlib: libiupSONAME, discardable.}
  283. proc GetColor*(x: cint; y: cint; r: ptr cuchar; g: ptr cuchar; b: ptr cuchar): cint {.cdecl, importc: "IupGetColor", dynlib: libiupSONAME, discardable.}
  284. type
  285.   Iparamcb* = proc (dialog: PIhandle; param_index: cint; user_data: pointer): cint {.
  286.       cdecl.}
  287.  
  288. proc GetParam*(title: cstring; action: Iparamcb; user_data: pointer; format: cstring): cint {. varargs, cdecl, importc: "IupGetParam", dynlib: libiupSONAME, discardable.}
  289. proc GetParamv*(title: cstring; action: Iparamcb; user_data: pointer; format: cstring; param_count: cint; param_extra: cint; param_data: ptr pointer): cint {. cdecl, importc: "IupGetParamv", dynlib: libiupSONAME, discardable.}
  290. proc Param*(format: cstring): PIhandle {.cdecl, importc: "IupParam", dynlib: libiupSONAME.}
  291. proc ParamBox*(param: PIhandle): PIhandle {.varargs, cdecl, importc: "IupParamBox", dynlib: libiupSONAME.}
  292. proc ParamBoxv*(param_array: ptr PIhandle): PIhandle {.cdecl, importc: "IupParamBoxv", dynlib: libiupSONAME.}
  293. proc LayoutDialog*(dialog: PIhandle): PIhandle {.cdecl, importc: "IupLayoutDialog", dynlib: libiupSONAME.}
  294. proc ElementPropertiesDialog*(parent: PIhandle; elem: PIhandle): PIhandle {. cdecl, importc: "IupElementPropertiesDialog", dynlib: libiupSONAME.}
  295. proc GlobalsDialog*(): PIhandle {.cdecl, importc: "IupGlobalsDialog", dynlib: libiupSONAME.}
  296. proc ClassInfoDialog*(parent: PIhandle): PIhandle {.cdecl, importc: "IupClassInfoDialog", dynlib: libiupSONAME.}
  297.  

tinc.nim IUP test script
Code: Text
  1. include iup
  2.  
  3. proc btn_exit_cb(ih:PIhandle):cint {.cdecl.}=
  4.   return IUP_CLOSE
  5.  
  6. var dlg, button, label, vbox: PIhandle
  7. var argc:cint
  8. var argv:ptr cstringArray
  9.  
  10. Open(argc, argv)
  11.  
  12. label =  Label("Hello world from IUP.")
  13. button = Button("OK", nil)
  14.  
  15. vbox = Vbox(label, button, nil)
  16. SetAttribute(vbox, "ALIGNMENT", "ACENTER")
  17. SetAttribute(vbox, "GAP", "10")
  18. SetAttribute(vbox, "MARGIN", "10x10")
  19.  
  20. dlg = Dialog(vbox)
  21. SetAttribute(dlg, "TITLE", "Ubuntu RPi")
  22.  
  23. SetCallback(button, "ACTION", btn_exit_cb)
  24.  
  25. ShowXY(dlg, IUP_CENTER, IUP_CENTER)
  26.  
  27. MainLoop()
  28.  
  29. Close()
  30.  


ubuntu@rpi4b:~/repo/Nim/examples$ nim c -d:release tinc.nim
Hint: used config file '/home/ubuntu/repo/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/ubuntu/repo/Nim/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: tinc [Processing]
/home/ubuntu/repo/Nim/examples/iup.nim(13, 3) Hint: 'libiupglSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(20, 3) Hint: 'libiupwebSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(19, 3) Hint: 'libiuptuioSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(16, 3) Hint: 'libiup_mglplotSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(17, 3) Hint: 'libiup_plotSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(11, 3) Hint: 'libiupcontrolsSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(12, 3) Hint: 'libiupglcontrolsSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(18, 3) Hint: 'libiup_scintillaSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(10, 3) Hint: 'libcdSONAME' is declared but not used [XDeclaredButNotUsed]
/home/ubuntu/repo/Nim/examples/iup.nim(9, 3) Hint: 'libiupcdSONAME' is declared but not used [XDeclaredButNotUsed]
CC: stdlib_system.nim
CC: tinc.nim
Hint:  [Link]
Hint: operation successful (22171 lines compiled; 6.781 sec total; 19.84MiB peakmem; Release Build) [SuccessX]
ubuntu@rpi4b:~/repo/Nim/examples$


Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #218 on: December 24, 2019, 03:27:53 PM »
I think I'm going to build an IUP app that allows you to select what resouces you need for you script and generates a custom include.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #219 on: December 24, 2019, 06:28:07 PM »
AIR,

Does Nim provide any debugging tools? Finding this niup bug by adding code until it breaks seem brute force.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #220 on: December 24, 2019, 08:52:41 PM »
I found the problem with the niup library. I don't know how to fix it but at least everything else works (compiles) I reworked the niup.nim file as part of my debugging effort.

To me this looks like an attempt at a shortcut to dropping the Iup prefix but  doesn't look well thought out. Maybe the 1.1.1 version I'm running says no way.

Code that causes the error
Code: Text
  1. const
  2. #  isshift* = iup_isshift
  3. #  iscontrol* = iup_iscontrol
  4. #  isbutton1* = iup_isbutton1
  5. #  isbutton2* = iup_isbutton2
  6. #  isbutton3* = iup_isbutton3
  7. #  isdouble* = iup_isdouble
  8. #  isalt* = iup_isalt
  9. #  issys* = iup_issys
  10. #  isbutton4* = iup_isbutton4
  11. #  isbutton5* = iup_isbutton5
  12.  

Attached is my iup.nim (niup rework)
« Last Edit: December 24, 2019, 09:45:06 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #221 on: December 25, 2019, 05:46:54 AM »
AIR,

The first time you built the shared objects for IUP there were multiple .so files. The latest tecmake.mak only builds one .so file. The static library is the same.

I think CD and IM are okay.

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #222 on: December 25, 2019, 11:16:29 AM »
It builds fine for me.  All static and dynamic libraries.  With the tecmake.mak I posted.

Offline John

  • Forum Support / SB Dev
  • Posts: 3598
    • ScriptBasic Open Source Project
Re: RaspberryBASIC.org Forum
« Reply #223 on: December 25, 2019, 11:25:07 AM »
Here are my lib build directories.


ubuntu@rpi4b:~/iup-dev/iup/lib/Linux53_arm64$ ls -l
total 3800
-rw-r--r-- 1 ubuntu ubuntu 2627956 Dec 21 22:31 libiup.a
-rwxr-xr-x 1 ubuntu ubuntu 1258520 Dec 21 22:31 libiup.so
ubuntu@rpi4b:~/iup-dev/iup/lib/Linux53_arm64$

ubuntu@rpi4b:~/iup-dev/cd/lib/Linux53_arm64$ ls -l
total 5648
drwxr-xr-x 2 ubuntu ubuntu    4096 Dec 21 22:24 Lua53
-rw-r--r-- 1 ubuntu ubuntu 1284338 Dec 21 22:22 libcd.a
-rwxr-xr-x 1 ubuntu ubuntu  892504 Dec 21 22:22 libcd.so
-rw-r--r-- 1 ubuntu ubuntu    1562 Dec 21 22:23 libcdcontextplus.a
-rwxr-xr-x 1 ubuntu ubuntu    7984 Dec 21 22:23 libcdcontextplus.so
-rw-r--r-- 1 ubuntu ubuntu   40324 Dec 21 22:23 libcdgl.a
-rwxr-xr-x 1 ubuntu ubuntu   40176 Dec 21 22:23 libcdgl.so
-rw-r--r-- 1 ubuntu ubuntu    7084 Dec 21 22:23 libcdim.a
-rwxr-xr-x 1 ubuntu ubuntu   14360 Dec 21 22:23 libcdim.so
-rw-r--r-- 1 ubuntu ubuntu   50350 Dec 21 22:23 libcdpdf.a
-rwxr-xr-x 1 ubuntu ubuntu   44088 Dec 21 22:23 libcdpdf.so
-rw-r--r-- 1 ubuntu ubuntu 1923682 Dec 21 22:23 libpdflib.a
-rwxr-xr-x 1 ubuntu ubuntu 1455088 Dec 21 22:23 libpdflib.so
ubuntu@rpi4b:~/iup-dev/cd/lib/Linux53_arm64$

ubuntu@rpi4b:~/iup-dev/im/lib/Linux53_arm64$ ls -l
total 9184
drwxr-xr-x 2 ubuntu ubuntu    4096 Dec 21 22:43 Lua53
-rw-r--r-- 1 ubuntu ubuntu 2228190 Dec 21 22:38 libim.a
-rwxr-xr-x 1 ubuntu ubuntu 1473784 Dec 21 22:38 libim.so
-rw-r--r-- 1 ubuntu ubuntu  317320 Dec 21 22:43 libim_fftw.a
-rwxr-xr-x 1 ubuntu ubuntu  205872 Dec 21 22:43 libim_fftw.so
-rw-r--r-- 1 ubuntu ubuntu  437912 Dec 21 22:39 libim_jp2.a
-rwxr-xr-x 1 ubuntu ubuntu  322440 Dec 21 22:39 libim_jp2.so
-rw-r--r-- 1 ubuntu ubuntu   12380 Dec 21 22:43 libim_lzo.a
-rwxr-xr-x 1 ubuntu ubuntu   17816 Dec 21 22:43 libim_lzo.so
-rw-r--r-- 1 ubuntu ubuntu  810614 Dec 21 22:40 libim_process.a
-rwxr-xr-x 1 ubuntu ubuntu  619472 Dec 21 22:40 libim_process.so
-rw-r--r-- 1 ubuntu ubuntu 1741958 Dec 21 22:42 libim_process_omp.a
-rwxr-xr-x 1 ubuntu ubuntu 1190616 Dec 21 22:42 libim_process_omp.so
ubuntu@rpi4b:~/iup-dev/im/lib/Linux53_arm64$


Remarking out the code I mentioned above makes the niup extension work as  a module.

Code: Text
  1. import niup
  2. import niupext
  3.  
  4. proc btn_exit_cb(ih:PIhandle):cint {.cdecl.}=
  5.   # Exits the main loop
  6.   return IUP_CLOSE
  7.  
  8. proc mainProc =
  9.   var dlg, button, label, vbox: PIhandle
  10.  
  11.   Open()
  12.  
  13.   label =  Label("Hello world from IUP.")
  14.   button = Button("OK", nil)
  15.  
  16.   vbox = Vbox(label, button, nil)
  17.   SetAttribute(vbox, "ALIGNMENT", "ACENTER")
  18.   SetAttribute(vbox, "GAP", "10")
  19.   SetAttribute(vbox, "MARGIN", "10x10")
  20.  
  21.   dlg = Dialog(vbox)
  22.   SetAttribute(dlg, "TITLE", "Ubuntu 64")
  23.  
  24.   # Registers callbacks
  25.   SetCallback(button, "ACTION", btn_exit_cb)
  26.  
  27.   ShowXY(dlg, IUP_CENTER, IUP_CENTER)
  28.  
  29.   MainLoop()
  30.  
  31.   Close()
  32.  
  33. if isMainModule:
  34.   mainProc()
  35.  




Merry Christmas AIR!
« Last Edit: December 25, 2019, 12:12:15 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: RaspberryBASIC.org Forum
« Reply #224 on: December 25, 2019, 12:23:33 PM »
riveraa@ubuntu:~/iup-dev/build$ for x in cd im iup;do printf "\n\n$x\n";ll $x/lib/Linux53_arm64;done


cd
total 5.6M
drwxrwxr-x 2 riveraa riveraa 4.0K Dec 25 13:45 Lua53
-rw-rw-r-- 1 riveraa riveraa 1.3M Dec 25 13:43 libcd.a
-rwxrwxr-x 1 riveraa riveraa 872K Dec 25 13:43 libcd.so
-rw-rw-r-- 1 riveraa riveraa 1.6K Dec 25 13:44 libcdcontextplus.a
-rwxrwxr-x 1 riveraa riveraa 7.8K Dec 25 13:44 libcdcontextplus.so
-rw-rw-r-- 1 riveraa riveraa  40K Dec 25 13:44 libcdgl.a
-rwxrwxr-x 1 riveraa riveraa  40K Dec 25 13:44 libcdgl.so
-rw-rw-r-- 1 riveraa riveraa 7.0K Dec 25 13:44 libcdim.a
-rwxrwxr-x 1 riveraa riveraa  15K Dec 25 13:44 libcdim.so
-rw-rw-r-- 1 riveraa riveraa  50K Dec 25 13:44 libcdpdf.a
-rwxrwxr-x 1 riveraa riveraa  44K Dec 25 13:44 libcdpdf.so
-rw-rw-r-- 1 riveraa riveraa 1.9M Dec 25 13:44 libpdflib.a
-rwxrwxr-x 1 riveraa riveraa 1.4M Dec 25 13:44 libpdflib.so


im
total 9.0M
drwxrwxr-x 2 riveraa riveraa 4.0K Dec 25 13:04 Lua53
-rw-rw-r-- 1 riveraa riveraa 2.2M Dec 25 13:00 libim.a
-rwxrwxr-x 1 riveraa riveraa 1.5M Dec 25 13:00 libim.so
-rw-rw-r-- 1 riveraa riveraa 310K Dec 25 13:04 libim_fftw.a
-rwxrwxr-x 1 riveraa riveraa 202K Dec 25 13:04 libim_fftw.so
-rw-rw-r-- 1 riveraa riveraa 428K Dec 25 13:00 libim_jp2.a
-rwxrwxr-x 1 riveraa riveraa 315K Dec 25 13:00 libim_jp2.so
-rw-rw-r-- 1 riveraa riveraa  13K Dec 25 13:04 libim_lzo.a
-rwxrwxr-x 1 riveraa riveraa  18K Dec 25 13:04 libim_lzo.so
-rw-rw-r-- 1 riveraa riveraa 792K Dec 25 13:01 libim_process.a
-rwxrwxr-x 1 riveraa riveraa 605K Dec 25 13:01 libim_process.so
-rw-rw-r-- 1 riveraa riveraa 1.7M Dec 25 13:03 libim_process_omp.a
-rwxrwxr-x 1 riveraa riveraa 1.2M Dec 25 13:03 libim_process_omp.so


iup
total 22M
drwxrwxr-x 2 riveraa riveraa 4.0K Dec 25 14:04 Lua53
-rw-rw-r-- 1 riveraa riveraa 2.6M Dec 25 13:47 libiup.a
-rwxrwxr-x 1 riveraa riveraa 1.3M Dec 25 13:47 libiup.so
-rw-rw-r-- 1 riveraa riveraa 4.6M Dec 25 13:52 libiup_mglplot.a
-rwxrwxr-x 1 riveraa riveraa 2.9M Dec 25 13:52 libiup_mglplot.so
-rw-rw-r-- 1 riveraa riveraa 480K Dec 25 13:48 libiup_plot.a
-rwxrwxr-x 1 riveraa riveraa 293K Dec 25 13:48 libiup_plot.so
-rw-rw-r-- 1 riveraa riveraa 4.4M Dec 25 13:58 libiup_scintilla.a
-rwxrwxr-x 1 riveraa riveraa 2.9M Dec 25 13:58 libiup_scintilla.so
-rw-rw-r-- 1 riveraa riveraa  29K Dec 25 13:47 libiupcd.a
-rwxrwxr-x 1 riveraa riveraa  30K Dec 25 13:47 libiupcd.so
-rw-rw-r-- 1 riveraa riveraa 614K Dec 25 13:47 libiupcontrols.a
-rwxrwxr-x 1 riveraa riveraa 331K Dec 25 13:47 libiupcontrols.so
-rw-rw-r-- 1 riveraa riveraa  22K Dec 25 13:47 libiupgl.a
-rwxrwxr-x 1 riveraa riveraa  24K Dec 25 13:47 libiupgl.so
-rw-rw-r-- 1 riveraa riveraa 247K Dec 25 13:47 libiupglcontrols.a
-rwxrwxr-x 1 riveraa riveraa 130K Dec 25 13:48 libiupglcontrols.so
-rw-rw-r-- 1 riveraa riveraa  17K Dec 25 13:58 libiupim.a
-rwxrwxr-x 1 riveraa riveraa  24K Dec 25 13:58 libiupim.so
-rw-rw-r-- 1 riveraa riveraa 286K Dec 25 13:58 libiupimglib.a
-rwxrwxr-x 1 riveraa riveraa 266K Dec 25 13:58 libiupimglib.so
-rw-rw-r-- 1 riveraa riveraa 309K Dec 25 13:59 libiuptuio.a
-rwxrwxr-x 1 riveraa riveraa 173K Dec 25 13:59 libiuptuio.so
-rw-rw-r-- 1 riveraa riveraa  20K Dec 25 13:58 libiupweb.a
-rwxrwxr-x 1 riveraa riveraa  26K Dec 25 13:58 libiupweb.so
riveraa@ubuntu:~/iup-dev/build$


Either you've made changes to the .mak file that broke stuff, or your build environment is not complete as far as the required development libraries go.

AIR.