Code Monkey home page Code Monkey logo

niup's People

Contributors

dariolah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

niup's Issues

Unable to install niup via nimble on Windows

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.

IUP modern designing

Is there a way to create a gui with transparency and rounded corners? If so do you have an example?

Fail to run hello world example

step to reproduce

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

infos

nim version: 1.0.6
nimble version v0.11.0
ubuntu 19.04 Disco Dingo

Static Build of iup ?

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

Error compiling hello sample

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()

Running examples - Problems with niupext

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)))()

static build of iup (success) on windows and broken links

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

Nim 1.1.1 NIUP Issues

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.