dariolah / niup Goto Github PK
View Code? Open in Web Editor NEWIUP FFI bindings for Nim
License: Other
IUP FFI bindings for Nim
License: Other
Hello, I am using windows, running on nim v1.0.6 and nimble v0.11.0. When I try to install niup via nimble, this happens:
C:\Users\Obro>nimble install niup
Downloading https://github.com/dariolah/niup using git
Tip: 2 messages have been suppressed, use --verbose to show them.
Error: Could not read package info file in C:\Users\Obro\AppData\Local\T
emp\nimble_394992\githubcom_dariolahniup\niup.nimble;
... Reading as ini file failed with:
... Invalid section: .
... Evaluating as NimScript file failed with:
... [Package]
... version: """3.28.1"""
... author: """Dario Lah"""
... description: """IUP FFI bindings"""
... license: """MIT"""
... backend: """c"""
... [Deps]
... requires: "nim >= 1.0.4"
... C:\Users\Obro\AppData\Local\Temp\nimble_394992\githubcom_dariolah
niup\niup_394992.nims(5, 22) Warning: imported and not used: 'strutils' [UnusedI
mport]
... printPkgInfo() failed.
C:\Users\Obro>
How could I fix this? Thanks.
Is there a way to create a gui with transparency and rounded corners? If so do you have an example?
install IUP lib as shown in the readme. the install script return:
'libiupcd.so' -> '/usr/lib64/libiupcd.so'
'libiupcontrols.so' -> '/usr/lib64/libiupcontrols.so'
'libiupglcontrols.so' -> '/usr/lib64/libiupglcontrols.so'
'libiupgl.so' -> '/usr/lib64/libiupgl.so'
'libiupimglib.so' -> '/usr/lib64/libiupimglib.so'
'libiupim.so' -> '/usr/lib64/libiupim.so'
'libiup_mglplot.so' -> '/usr/lib64/libiup_mglplot.so'
'libiup_plot.so' -> '/usr/lib64/libiup_plot.so'
'libiup_scintilla.so' -> '/usr/lib64/libiup_scintilla.so'
'libiup.so' -> '/usr/lib64/libiup.so'
'libiuptuio.so' -> '/usr/lib64/libiuptuio.so'
'libiupweb.so' -> '/usr/lib64/libiupweb.so'
install niup with nimple:
nimble install niup
copy past the quickstart example from the readme into hello.nim
run nim c -r hello.nim
, which return:
/home/joe/nim/hello.nim(2, 8) Error: cannot open file: niupext
and if I run ./hello
I get:
libiup.so: cannot open shared object file: No such file or directory
could not load: libiup.so
nim version: 1.0.6
nimble version v0.11.0
ubuntu 19.04 Disco Dingo
Hi,
I really liked the update you made to the iup nim module,
It is the only sane gui available as i can see now with complete controls and multiplatform
I just have a request if any way to build it and link it statically to the app instead of shipping the original iup.dll
Hi, sorry not an issue, just curious.. what is the editor used on the screenshots ?
thanks.
OS: 5.15.7-arch1-1
ARCH: x86_64
NIM VERS: 1.6.2 Switched to Nim 1.6.2
[nixfreak@chaosArch nim-iup-examples]$ nim c -r --threads:on hello.nim
Hint: used config file '/home/nixfreak/.choosenim/toolchains/nim-1.6.2/config/nim.cfg' [Conf]
Hint: used config file '/home/nixfreak/.choosenim/toolchains/nim-1.6.2/config/config.nims' [Conf]
.................................................................
/home/nixfreak/nim/gui/nim-iup-examples/hello.nim(8, 7) Error: type mismatch: got <>
but expected one of:
proc Open(argc: var cint; argv: ptr cstringArray): cint
expression: Open()
SOURCE:
import niup
proc btn_exit_cb(ih:PIhandle):cint {.cdecl.} =
# Exits the main loop
return IUP_CLOSE
proc mainProc =
Open()
var
label = Label("Hello world from IUP.")
button = Button("OK")
vbox = Vbox(label, button)
vbox.alignment = IUP_ACENTER
vbox.gap(10)
vbox.margin(10, 10)
var dlg = Dialog(vbox)
dlg.title = "Hello World"
# callbacks
button.action = btn_exit_cb
ShowXY(dlg, IUP_CENTER, IUP_CENTER)
MainLoop()
Close()
if isMainModule:
mainProc()
Maybe similar to an earlier problem, i'm on Windows, install niup with:
nimble install niup
Says installed successfully, version 3.30
Try to run any example that uses niupext and get similar to this:
c:\Users\Neil\Documents\Nim Files\nim-iup-examples-master\example4_3.nim(5, 8) Error: cannot open file: niupext
So i look in .Nimble/niup folder and no niupext.nim file in there??
I then download the .zip and extract to the .Nimble/niup folder..... niupext.nim file now in there.
Try to compile again and now i get:
c:\Users\Neil\Documents\Nim Files\nim-iup-examples-master\example4_3.nim(160, 13) Hint: 'name' is declared but not used [XDeclaredButNotUsed] c:\Users\Neil\Documents\Nim Files\nim-iup-examples-master\example4_3.nim(160, 8) Hint: 'dir' is declared but not used [XDeclaredButNotUsed] c:\Users\Neil\Documents\Nim Files\nim-iup-examples-master\example4_3.nim(584, 3) Error: illegal discard proc, did you mean: SetCallback(canvas, cstring("ACTION"), cast[Icallback](cast[Icallback](canvas_action_cb)))()
Hi,
Thanks a lot for writing this lib which seems to be the only mature, reasonably light and documented.
Using nim-lang/iup#5 I managed to statically compile your example (on windows ; IUP 3.30 ; mingw64) with
nim c -d:release --opt:speed --dynlibOverrideAll --passL:-mwindows -L:lib/libiup.a -L:lib/libiupcd.a -L:lib/libiupim.a -L:lib/libiupimglib.a -L:-lgdi32 -L:-luser32 -L:-lcomdlg32 -L:-lcomctl32 -L:-lole32 -L:-luuid test.nim
where test.nim is your example, and /lib contains prebuild libraries for mingw64 static. The resulting exe runs fine (stand-alone in a sandbox, and weights 1.68Mb.
For convenience, I also copied the dll (prebuild mingw64 dynamic) in the same directory as the debug exe for development in VS code.
You could maybe explain this (installation and compiler option) ? it seems interesting for some people, and this setup is complicated for newbies.
--
By the way, two broken links in "Installation"
Download tips: https://www.tecgraf.puc-rio.br/iup/en/download_tips.html
Compile from source : https://www.tecgraf.puc-rio.br/iup/en/guide.html#buildlib
I discovered a couple issues using Nim 1.1.1 with niup. It works fine in Nim 1.0.4.
These constants throw a hard error with no line number reference and a message from error.nim about not being KIND. (indents not being shown)
const
isshift* = iup_isshift
iscontrol* = iup_iscontrol
isbutton1* = iup_isbutton1
isbutton2* = iup_isbutton2
isbutton3* = iup_isbutton3
isdouble* = iup_isdouble
isalt* = iup_isalt
issys* = iup_issys
isbutton4* = iup_isbutton4
isbutton5* = iup_isbutton5
The with doesn't work either in 1.1.1.
withPIhandle vbox:
"ALIGNMENT" "ACENTER"
"GAP" "10"
"MARGIN" "10x10"
As the title says, can we link ipu/cd/... into the application so that to release one-file program?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.