on windows. I have tested the following:
wNim, which is an alive one among what I have tested and is updated now and
then. it supplies many common controls. it can produce tiny size application,
but only for windows. I like its autolayout DSL very much, which lets us do the
layout in a very bri
thank you for pointing out sciter. although it looks nice, I found the document
or tutorial is lack, at least for python/nim language.
1\. [https://github.com/lc-soft/LCUI](https://github.com/lc-soft/LCUI) LCUI is
a C language UI lib which uses XML and CSS to describe interface structure and
style. As a result, the UI can be more beautiful.
2\. [https://github.com/ying32/govcl](https://github.com/ying32/govcl)/ a
Golang GUI wh
I am using windows OS.
For example, a GUI application is written in nim, in which I choose a lot of
excel files to be processed, input the column name in excel files to be read,
choose a destination output file name; then these parameters are passed to
another application in Python.
The Python
the choice depends on your desire heavily. if you just need some button,
dialogue box, most of the gui lib maybe work. but if you need grid/cell, web
browser and math/latex, only maybe the famous wxdigets/qt, and not so famous
iup can work.
there is a C interface to fltk by D. J. Peters for freebasic language. But
since dynamic library is supplied, we can use FLTK-C in other language. As a
result, I translate the rich freebasic examples into nim. You can check it at
[https://github.com/retsyo/FLTK_nim](https://github.com/retsyo/FLT
as we all know, both of
import strformat
var
i = 16
echo fmt"{16:x}"
echo fmt"{i:x}"
Run
print 10
now, is it possible to use the format specifier in variant f? None of the
following is corrected
import strformat
var
As
[https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrivestringsw](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrivestringsw)
said, the sting in returned lpBuffer is
C:\\\0D:\\\0
Run
then we can spil
in my simple code, there is a spacing of 50 between text control and frame
border. However if I use
H:|[label, groupText]|
Run
when run the EXE, I get
E:\prg\nim\nim-1.0.6\lib\core\macros.nim(581) layout
C:\Users\USER\.nimble\pkgs\wnim-0.10.1\wNim\p
Here is a little program which record the text to a wave file. I have tested
the similar Python code
import winim/com
#~ from comtypes.gen import SpeechLib
var obj = CreateObject("SAPI.SpVoice")
obj.speak "Nim is a statically typed, imperative programming language."
is there any way or package to query pc specification on Ms Windows is?
to be clear, foe example I need to know: CPU type(for example Intel Core
i7-8700 @ 3.2Ghz), display card(e.g. Nvidia geforce 1080), 2
hardisk(st31000528as 1T, kbg30xxx Toshiba 256G), memeory(16G), just like what
cpu-z does.
although it is 3 years ago, I think it is better to write down
Now
[https://github.com/nim-lang/sdl2/wiki/Windows-Binaries](https://github.com/nim-lang/sdl2/wiki/Windows-Binaries)
supplies DLL for windows 32bits
however, windows 64bits has been used for many years, so
1\. I can't open the link
as the title says,
[https://nim-lang.github.io/Nim/hcr](https://nim-lang.github.io/Nim/hcr) is
outdated due to the update of sdl2. any plan to update? thanks
offtopic, in the table, there are very long list like "a":a ("wAquamarine":
wAquamarine). Is there an concise way to write it?
@Libman [http://www.rapideuphoria.com](http://www.rapideuphoria.com)/
[http://hp.vector.co.jp/authors/VA008683/english/index.htm](http://hp.vector.co.jp/authors/VA008683/english/index.htm)
[https://www.basic4gl.net/mobile](https://www.basic4gl.net/mobile)
[https://www.spiderbasic.com](https://ww
vlang.io seems to have a very easy way to use C library which will broaden its
ecosystem more easily than other language(including nim) does
ok, other parts of vlang are nearly jokes till now
here is the code on the [https://nim-lang.org](https://nim-lang.org)/
however,
= range 0..9223372036854775807(int)
Run
how do I know? Just assign a float to age. then nim refuse to compile.
so it is a very bad example
1. the comment is wrong. btw, is there any builtin
Here is the code from a local discussion group
# foo.nim
import nimpy
proc foo(): seq[array[3,int]]{.exportpy.}=
var a:seq[array[3,int]]
for i in 1..1000:
a.add([i,i*2,0])
return a
Run
and
# a.py
import
here is the question two: I suspected that set a as a seq in foo.nim is not a
good idea for speed( that is true to set a as a list in python version), so
what is a better solution?
question three, as we can find that both python 2 and 3 can use the generated
pyd files. So the pyd is not a normal python extension which depends on the
python version. How does it come? Will this feature slow down the extension?
Thanks
library talks. for me, a lot of excel files have to be treated, so I only find
and have to rely on python and pandas
can we use it with 64 bits nim?
why "Projects like Nim and D can never be failures"? what is the common between
them? open source? what do you think about redlang
[https://www.red-lang.org](https://www.red-lang.org)/ which is said to promote
new idea of rebol language, however I think red lang is doomed to fail since it
focus
Recently, I read that it is the first time that human finds 3 integers x, y and
z which make x^3+y^3+z^3=33, where the finding is
(8866128975287528)^3+(-8778405442862239)^3+(-2736111468807040)^3 in this March
2019. Till March 2019, we still can't find x, y and z for some numbers, for
example, 4
there is no official/bundle-in function/operator for ptr type, so what is the
purpose of ptr type in nimlang?
for example
unsigned char imgdata[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0...};
Ihandle* image = IupImageRGBA(32, 32, imgdata);
Run
I tried
var imgdata = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0...}
var image = iupImageRGBA(32, 32, imgdata)
I have checked c2nim which seems can do most work for using functions in
dynamic library without any dynamic linking library file.
I also checked wxNim source which seems to be translated by hand for static
link, but of cause it can link dynamic library. But is there an aided tool can
do most o
Maybe you have forgotten the binding, but I am using wxnim from [PMunch
fork](https://github.com/PMunch/wxnim) from you,
[Araq](https://github.com/Araq/wxnim), it is not my wrapping code. And the
example2 is in the wxnim too.
nim cpp -r -d:useSysAssert -d:useGcAssert example2.ni
I use nim in MSYS2+Mingw64 on Windows 7 64 bits.
The involved code can be download
[here](https://forums.wxwidgets.org/viewtopic.php?f=27&t=45513) which uses
[wxnim](https://github.com/PMunch/wxnim) . And I have stated the [details to
compile wxWidgets](https://github.com/PMunch/wxnim/issues/12
nice, suggest to use getAppDir in os to let nimterlingua load the trasnlation
file from the app path defaultly
a simliar question. In my code, losts of XExNew, XXExDelete (in fact, more than
these 2) proc will be created according to the same-name function in DLL file.
For example
const fltk = "fltk-c-1.3.3-64.dll"
type long = int64
type Fl_ButtonEx* = object
proc Fl_ButtonE
on my machine( MSYS2 + MingW64, windows 64bits)
$ wx-config --libs
-LE:/msys64/mingw64/lib -pipe -Wl,--subsystem,windows -mwindows
-lwx_mswu_xrc-3.0 -lwx_mswu_webview-3.0 -lwx_mswu_html-3.0 -lwx_mswu_qa-3.0
-lwx_mswu_adv-3.0 -lwx_mswu_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_ne
hi, Stefan_Salewski You find the lazy bone in me exactly, thank you for the
explaination. Now the original Code( in [FreeBASIC](https://www.freebasic.net/)
)
#include once "fltk-c. bi"
sub QuitCB cdecl (byval self as Fl_Widget ptr,byval userdata as any ptr)
flMessageT
The style is the last thing to consider.
The first thing is to make a full and corrected binding with all examples
written in nim without any problem, so I have to keep the original lower/upper
case in code in order to refer to the original header files( there are both C
and FreeBasic) and exam
updated. now most of the problem codes are:
1. OpenGl related
2. FreeBasic macro, or in other word, C's #define related. So that almost no
function has EX in the name can run
3. Fl_Shared_ImageImages related
The C code
int setCallback(Fl_Widget* wgt, Fl_Callback *cb, void *pdata=NULL, int
num=1);
Run
can be translated into
proc setCallback*(wgt: ptr Fl_Widget; cb: ptr Fl_Callback;
pdata: pointer = nil; num: cint = 1): cint
guys, I think it is far beyond my ability to create my own widget
1. Yes, [FLTK]([http://www.fltk.org](http://www.fltk.org)) uses C++, but
[D.J.Peters's FLTK **C** for
FreeBasic]([https://www.freebasic.net/forum/viewtopic.php?f=14&t=24547&start=180](https://www.freebasic.net/forum/viewtopic.php?f=14&t=24547&start=180))
supplies a C interface() just like the
I think most of the post you mentioned will be closed by stack overflow
moderator very soon
Thanks
I don't mean to throw tons of code line, so I extract some typical ( at least I
think) function declaration lines, even in C header files they looks the same.
The other lines, which I did not enclose here, can be treated by c2nim or my
newbie's brain.
As for the C header files, actually
the code is not too long for me to replace all DOP_COLOR(sth) with HIWORD(sth),
LOWORD(sth) by hand. But it is some long for concat thus the code will be a
mess.
But to speak generaly, there is no something like #define A B directive in C,
which only replace A with B literally, in nim, isn't? Y
first, some questions about pointer
**question 1**
void Fl_Widget_TrackerDelete(Fl_Widget_Tracker* & wt);
Run
c2nim says Error: token expected: )
**question 2**
void flFileChooserCallback(void(*cb)(const char* f));
Run
c2nim say
sorry, I can't still grasp the idea
if emit is used, then how to use DOP_COLOR in nim code obviously,
{. emit: """
#define DOP_COLOR(col) HIWORD(col), LOWORD(col)
""" .}
var opcodes = [
FL_DOP_COLOR ,DOP_COLOR(FL_RED),
FL_DOP_LINE,
]
I have read
[https://forum.nim-lang.org/t/3199](https://forum.nim-lang.org/t/3199) but I am
still puzzled
my situation is, I need the #define part works like that in C/FreeBasic, so if
#define DOP_COLOR(col) HIWORD(col), LOWORD(col)
Run
then the code to create array
for example, in FLTK C for FreeBasic, there is (faked) enum
FL_TEXT_DISPLAY_WRAP_MODE, i.e.
type FL_TEXT_DISPLAY_WRAP_MODE as ulong
Run
which is used in funtions like
declare sub Fl_Text_DisplayWrapMode(byval td as Fl_Text_Display ptr,
byval wrap
[https://github.com/retsyo/FLTK_nim](https://github.com/retsyo/FLTK_nim)/
As all my released projects, it needs more works to finish. I do hope someone,
who knows nimlang well, can join or give suggestions
import fltk_main
proc ButtonClick (button: ptr FL_WIDGET, arg: point
In freebasic, for code
#macro DeclareEx(_name_)
declare function _name_##ExNew(byval x as long, byval y as long, byval w as
long, byval h as long, byval title as const zstring ptr=0) as _name_##Ex ptr
declare sub _name_##ExDelete (byref ex as _name_##Ex ptr)
In freebasic, for code
#macro DeclareEx(_name_)
declare function _name_##ExNew(byval x as long, byval y as long, byval w as
long, byval h as long, byval title as const zstring ptr=0) as _name_##Ex ptr
declare sub _name_##ExDelete (byref ex as _name_##Ex ptr)
Let me ignore the data type first ;) I hope there is a
VisualBasic-Freebasic-C-Nim data type comparasion sheet
type
Fl_Callback* = proc(widget: ptr Fl_Widget, pData: ptr any):cint {.cdecl.}
proc ButtonClick (button: ptr FL_WIDGET, arg: ptr any):cint {.cdecl.} =
F
on windows, nimgen will run something like
cmd /c "c2nim ..."
Run
but I am using MSYS2+Mingw, thus "cmd /c" will make the command invalid. Is
there a solution?
I have posted days ago
[https://forum.nim-lang.org/t/4522](https://forum.nim-lang.org/t/4522) in which
I try to bind xcgui which is a free 32bits dll for windows
Now I try to bind FLTK([http://www.fltk.org)](http://www.fltk.org\)). I can
compile FLTK, test, examples and fluid with my MSYS2+Ming
do you mean
proc OnClick*(bHandle: var bool): cint {.exportc, cdecl.} =
setupForeignThreadGc()
var
sel = XC_MessageBox(nil, "炫彩界面库pText", "pCaption", 1)
bHandle = true
result = 0
tearDownForeignThreadGc()
Run
it still
I have tried to go here with and without Lantern.
I don't know Go-lang, and I don't have time to learn it. As I always state, I
_do not_ make a living on programing, I only program in my spare time,
sometimes I make some app to help me or co-worker in job. That is why I use
Python mainly because Python is simple and has tons of libraries which
I have found that no mmatter the is cast[cstring] or not, the compiled app
still crash after I click the button and the msgbox shows
here is the line in C header
XC_API BOOL WINAPI XEle_RegEventC(HELE hEle, int nEvent, void *pFun);
Run
here is what VB code does
I am trying to write a binding for www.xcgui.com which is a GUI lib for
windows. The initial code is on
[https://github.com/retsyo/xcgui_nim](https://github.com/retsyo/xcgui_nim)
but I met some questions. for example
import ../../xcgui
import winim/inc/[windef, wingdi]
imp
I have tried IE, Firefox and Chrome on my Win7 64bits with and without proxy,
but in these months it is very hard for me to load
[https://forum.nim-lang.org](https://forum.nim-lang.org)/ or any posts url. No
error is displayed, all these web browsers just finished with a blank page but
the titl
sorry to reply in this old posts. but I am still (I almost have spent one year)
looking for GUI solution(s) which have already exposed many widgets/controls
for windows OS. So I really want to know
1\. which is the latest sciter binding for nim? Google finds
https://github.com/oskca/nsciter whi
in the VB lib, which calls functions in 32bits DLL, there are something I am
not very sure
1\. many arguments are declared as LONG in the VB files. I found that LONG is
signed 64-bit integers on
[https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/long-data-type](
thanks, but I will embed the grid in the GUI which has other controls, so I
think ZeeGrid is not the solution.
BTW, I think nim is still too young in its modules to fit my work. Maybe I made
an impatient decision to learn and try to replace python yet.
can we use something like wx.grid or wx.lib.mixins.listctrl now for a
ms-Excel-like datasheet app?
sorry, I mean what if we use python in nim for python's packages, for example
matplotlib for plotting, sympy for symbolic calculation. It is hard for human
to find and ship all dependence, so that is why pyInstaller/py2exe exists to
bundle a python app for releasing.
for kinds of solution, I have one question: how to compile the nim app who uses
python inside, so that this app can be released to users without python on his
computer
BTW, the discussion here make me be afraid, perhaps one hours later, the
license file for Nim will add one line:
If you don't use Nim's conventions, please DO NOT use Nim
Run
I respect every contribution to Nim. But don't make conventions be a religion.
ok maybe you can make it yourself's religion, but do not command all others do
so.
In fact, I use wxPython so I can learn wNim without too hard work. wNim is the
first(and till now the only) library for me to make a
if it is too off-topic, please delete it, thanks
I have old applications from whose name I think they uses LZW compression.
However I checked some LZW libs(C/python/nim) but none of them yields the same
output files. I think the DOS app uses different code symbols during
compression. So how can
I, a programming amateur and (always) newbie, released my msgbox control for
[https://github.com/khchen/wNim](https://github.com/khchen/wNim), which can
specify the font for message and buttons , at
[https://github.com/retsyo/nim-myMsgBox](https://github.com/retsyo/nim-myMsgBox)
I don't have mu
blush this is the 2nd time that I met and asked the same question these days.
There is a long way for me to get familiar with Nim from a Python user
view-of-point.
thanks again
In my function to make wFont for
[https://khchen.github.io/wNim/](https://khchen.github.io/wNim/), the following
2 can work
import wNim
proc makeFont1(fontMessage: int): wFont {.discardable.}=
var
fontTmpMessage: wFont = Font(12, weight=wFontWeightBold)
Aha, thanks. I have just found
[https://github.com/jyapayne/nim-extensions](https://github.com/jyapayne/nim-extensions)
and rewrite the code. Now it seems that there is no much difference between
nim-extensions version and your type version, but nim-extensions version can be
understood easily f
thanks anyone. I am using python in which
def f(size=1):
if size == 1:
widFrame = 320
hiFrame = 200
else:
widFrame = 3200
hiFrame = 2000
print(widFrame, hiFrame)
f()
Run
will says
I try to make a control type in
[https://khchen.github.io/wNim/](https://khchen.github.io/wNim/), so I modified
the examples coming with wNim.
The control will work like this: after click any of the 2 buttons on the frame,
the frame will be closed, and a number will be returned to tell which bu
In my question, some buttons are created by amount given by parameter
numOfButtons. When a button is clicked, its holder frame is closed and the
index( begins from 0) is returned. But I found that no matter which button is
clicked, only the last(in the case of numOfButtons==3, the last index is
for
proc f(size=1) =
if size == 1:
var
widFrame = 320
hiFrame = 200
else:
var
widFrame = 3200
hiFrame = 2000
echo (widFrame, hiFrame)
f()
Ru
finally I found that wNim.res is actually obj file which can be read by ld of
GCC, not res file
we can make it by
wnim.rc wnim.o
cp wnim.o wnim.res
Run
In fact, I am using
[https://khchen.github.io/wNim](https://khchen.github.io/wNim)/ with my nim 64
bits. All demos compile and run without problem
In some of the demo files, there is a line
{.passL: "wnim.res" .}
Run
which use a 32,468 bytes wnim.res
But I found th
on my Msys2 + Mingw64 on Win7 64 bits, even echo 1 gives different filesize
when the same -d:release are used. So what makes the difference and how to
strip down besides strip/upx?
source,0.18.0 0.18.1(git cloned)
echo 1, 462,025
is there a module just like what
[https://www.sympy.org](https://www.sympy.org)/ does? sympy has a long list of
feature here:
[https://www.sympy.org/en/features.html](https://www.sympy.org/en/features.html)
thanks
import re
import unicode
var txt = "自我 我们 我" # this is actually read from external file
#~ txt = txt.toRunes()
# type mismatch: got but expected 'string'
var result = txt.findall(re".{0,1}我.{0,1}")
for i in result:
echo i # "自我", "我们", "我" are e
echo 1 == 0 # space in the beginning and end of ==
echo 1==0 # no space
Run
can be compiled and run without warning/error
however
echo 1== 0
Run
can be compiled and run as expected, but there is a warning ` Warning: Number
of spaces aroun
thanks, I don't mean to export word from module which is the next step
currently, what I met is that the following command line version cannot be
compiled,
R:\CheckIt.nim(709, 5) Error: undeclared identifier: 'word'
Run
because there is no global variant word so chec
In my situation, I translate a python code into nim
# I am cli.py
def checkHeading():
word.Selection.HomeKey(Unit=win32com.client.constants.wdStory,
Extend=win32com.client.constants.wdMove)
do some check on Heading, then display message
Thanks for updating one question: how to read COM object's constants? In
python, we can do
import win32com.client
word = win32com.client.gencache.EnsureDispatch("Word.Application")
print(win32com.client.constants.wdLineSpaceExactly)
word.Quit()
Ru
I am using Nim Compiler Version 0.17.2 (2017-09-10) [Windows: amd64] with
MSYS2+MingW64 on Win7 64 bits.
I know test:test.txt is not a valid DOS/Windows filename. So how to detect it
in code? Thanks
import os
try:
copyFile("test.txt", "test:test.txt")
except:
not an image one:
[https://github.com/nim-lang/cairo](https://github.com/nim-lang/cairo)
#
[https://github.com/barcharcraz/nim-freeimage](https://github.com/barcharcraz/nim-freeimage)
a nimrod wrapper for FreeImage
Latest commit 695e4d4 on Apr 22 2014
#
[https://github.com/barcharcraz/nimlibpng](https://github.com/barcharcraz/nimlibpng)
nimrod wrapper for libpng
Latest commit 79
I am using mingw64/clang64 in Msys2. But I found that the exe file build by
clang runs very slower than exe by gcc.
The nim is a fresh build from github source yesterday
$ nim
Nim Compiler Version 0.17.1 (2017-07-07) [Windows: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf
2\. gpu/cuda program, because there is no(?) file.a for mingw under windows for
example
[https://github.com/unicredit/nimcuda](https://github.com/unicredit/nimcuda)
$ cd /r/nimcuda-master/examples/
$ nim c -r fft.nim --cincludes:"/r/nimcuda-master/c2nim"
CC: nimcuda_cuC
I am using Msys2 + Mingw64 on win7 64 bits. Almost everything is ok, except:
1\. for blas, for exampe
[https://forum.nim-lang.org/t/3029](https://forum.nim-lang.org/t/3029)
$ cd /r/arraymancer/tests/
$ nim c -r test_operators_blas
Hint: [Link]
Hint: operation successful
so what is the source file for
[https://nim-lang.org/docs/manual.html](https://nim-lang.org/docs/manual.html)?
I looked into the nim's source but only found pure txt file
can sortedbyit support optional "reversed" arguement?
currently, if I only knew the 2-steps method:
var people3 =people1.sortedByIt(it.name)
var people4 = people3.reversed()
echo people4
I don't konw whether the above implementation is high effiency. what if an
i
Thanks, LeuGim. **`When`** does work. However
[https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement](https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement)
still be Greek for me.
* * *
more question I, a lazy none programmer practitioner, met
thanks but set cp936 seems do not work in msys2
[https://github.com/zacharycarter/blt-nim](https://github.com/zacharycarter/blt-nim)
may be a solution for simple console-like interactive
thanks, and I found
echo type("text") is string
this is what I get currently. Most functions in libxl can be exposed in the
same way
But something still puzzled me, or I have not know yet in nim:
1. for xlBookAddSheetW, the last arg is SheetHandle initSheet actually. But I
used int. How to cast a number to SheetHandle?
2. how to judge th
the first question, I translated
typedef struct tagBookHandle * BookHandle;
to
type
tagBookHandle* {.final, incompleteStruct, importc: "tagBookHandle".} =
object
BookHandle* {.importc: "BookHandle".} = ptr tagBookHandle
Am I right?
Bu
This post is related to
[https://forum.nim-lang.org/t/2977/2](https://forum.nim-lang.org/t/2977/2), in
which I said "For commercial products to read/write XLS/XLSX, I found
[http://libxl.com/](http://libxl.com/)"
So I started this binding work on June 18th 2017.
However I am totally newbee in
actually I have tested getCurrentEncoding, which gives gb2312 in both msys and
DOS as Araq says. So what is the solution?
I am a Chinese Windows user.
I use Msys2+Mingw64 (export LANG="EN.UTF-8") to compile nim app. But I also use
windows7 DOS console(the default codepage is cp936, which is almost gb2312).
The following code performs different in msys2 and windows's console.
So my question, how to let the EXE echo
As far as I know, there is no nim wrapper for libxlsxwriter. The "Interfacing C
and Nim" and "Converting C code to Nim" part on
[https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers](https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers)
may be useful.
As for reading XLS, I found
[h
1 - 100 of 110 matches
Mail list logo