Native GUI development for MacOS

2021-01-02 Thread Araq
It doesn't help that Apple keeps changing everything. We like Java, use that, no wait, use Objective C. You can use Carbon, wait no, use Cocoa, wait no, use Swift UI. Use OpenGL, no wait, ...

Cross-Compiling for Windows 32-bit with ChooseNim Install

2021-01-02 Thread Araq
It's rather easy when you don't use Choosenim. Download our 32bit zip, unpack, run "finish.exe". For a cross compile, download our 64bit zip, unpack, install the MingW of your choice, add it to your %PATH% and use `--cpu:i386 --os:windows` for the Nim compiler invocation.

What Nim projects are you working on?

2021-01-02 Thread adnan
I am currently working on a simple invoice creation tool for sole traders. Currently thinking what UI choices to make when the user has made a wrong input in Gtk. (Not sure how to force-contain the image into the frame) Since I am using a popover widget to collect data, really not sure where to

Native GUI development for MacOS

2021-01-02 Thread snej
> Actually its just amazing, why so obvious task like UI for mac Because it’s difficult, and a large task considering the API surface area. Also, IMHO a large proportion of the OSS/hacker community either use Linux ... or if on a Mac don’t really care about apps other than Terminal and a web br

Own numeric type

2021-01-02 Thread snej
Sounds like you want an enum, with those integers assigned to the values.

Own numeric type

2021-01-02 Thread cantanima
Do you have some unusual arithmetic going on here? in that case you might want to define a class, and/or use an enumeration.

Cross-Compiling for Windows 32-bit with ChooseNim Install

2021-01-02 Thread chrisheller
I haven't cross-compiled from a Windows OS, but you can take a look at the cross compiling setup here It builds 32 bit and 64 bit Windows binaries from Mingw64 (but from a Linux host)

Own numeric type

2021-01-02 Thread Zoom
The point of having a numerical type is to have the ability to perform mathematical operations, but in case of a restricted set of numbers most of the time you'll be getting answers outside of the set, so you still need to perform checks afterwards. So either you just use the regular numbers and

Docker image for cross compiling

2021-01-02 Thread chrisheller
This is now current with Nim 1.4.2. There are tags for 1.0.10 and 1.2.8 as well.

arraymancer ``

2021-01-02 Thread Nobody
Yes, nimhdf5 works great. Thanks @Vindaar. I'll try to open an issue on the arraymancer repository.

how use custom event inherited from DOM Event in javascript?

2021-01-02 Thread treeform
Have you tried just casting the event you get to the vent you want? `cast[Event]` ? I usually do that with JS events see here:

Own numeric type

2021-01-02 Thread lqdev
That's not a language feature, possibly due to the low number of actual use cases for it.

Error Using _kbhit with .importc

2021-01-02 Thread Chris3606
Hm. Yeah I think a full implementation of this would require implementing the basic keyboard code via getConsoleInput and peekConsoleInput as needed for other items.

Cross-Compiling for Windows 32-bit with ChooseNim Install

2021-01-02 Thread Chris3606
Hi, I have installed Nim v1.4.2 installed via choosenim on an x64 Windows box, and allowed it to install the default MinGW64 toolchain. It works fine until I try to cross-compile an executable to Windows 32-bit. I'm aware MinGW is rather fiddly when it comes to cross-compiling to x86 targets, h

What am I doing wrong with streams

2021-01-02 Thread Lecale
Whenever I sit down to write a program I know that I will do something wrong. Generally that doesn't stop me from coding something that works, but in [this case](https://github.com/Lecale/piggy/blob/main/piggy.nim) it has. I open an input and an output stream from osproc's StartProcess. In the i

Creating Custom DLLMain using MSVC

2021-01-02 Thread Chris3606
Hi, I'm currently attempting to create a DLL with a custom DLLMain function in Nim. Based on [this forum post](https://forum.nim-lang.org/t/1973\]) , I created the DLL as follows: import winim/lean proc NimMain() {.cdecl, importc.} proc DllMain(hinstDLL: HINSTANC

C++ bindings - doubt with an argument's default value

2021-01-02 Thread mantielero
Thanks. Understood. It looks I have to do: proc constructMaterial*(mat: Material, copyop: CopyOp = constructCopyOp(CopyFlags(SHALLOW_COPY))): Material {.constructor,importcpp: "osg::Material::Material(@)".}## Copy constructor using CopyOp to manage deep vs shallow copy.

Native GUI development for MacOS

2021-01-02 Thread Neodim
I've tried nimx one of the first, it works fine with OSX but is far from native :( Actually threre is one wrapper: , it emits Objective-C commands directly to Cocoa API, as I understand. It works perfect but only for two things: file open and sa

Own numeric type

2021-01-02 Thread micunek
Hi All, Could someone pls. help me with this: I would like to create own numeric type which consists for example only from these numbers "0,1,3,6,8,9". I was successful with range: type my_num_type = range[0..9] However I do not want to have 2,4,5,7 there. Thanks Peter

Native GUI development for MacOS

2021-01-02 Thread cblake
You might try [nimx](https://github.com/yglukhov/nimx). I've never assessed how "native look & feel" it is, but it claims to support MacOS and is well maintained.

Native GUI development for MacOS

2021-01-02 Thread Neodim
Thanks for reply, I've tried wxnim but it does not work out of repository: it returns a dozen of various errors upon compilation of its examples. Same time wxWidgets itself was compiled fine at one click. I guess it is due to non maintainable code which is not up to date to current NIM and wxWid

C++ bindings - doubt with an argument's default value

2021-01-02 Thread haxscramper_
It seems like `Options` is implicitly convertible to `CopyOp` on C++ side, but this is not the case in nim. In general, C++ default arguments should be wrapped using `arg: Type = initType(defaultValue)` where `toType` is wrapper for implicit conversion constructor on the C++ side. In C++ defaul

C++ bindings - doubt with an argument's default value

2021-01-02 Thread mantielero
I have doubts with the following header: [Material](https://github.com/openscenegraph/OpenSceneGraph/blob/40bddd8d9532620dc704adce0d2fb0c854d62d0f/include/osg/Material#L38) from OpenSceneGraph: namespace osg { /** Material - encapsulates OpenGL glMaterial state.*/ class OSG

Cancelation points in async

2021-01-02 Thread mashingan
Modifying your 2nd example import std/[asyncdispatch, sugar] var connectionAlive: bool = true type Cancellation = proc(): bool proc test(c: Cancellation) {.async.} = var x = 0 while connectionAlive: await sleepAsync(1000) # await for heartbea

Advent of Nim 2020 megathread

2021-01-02 Thread miran
With some recent changes and optimizations (days 17 and 24 mainly), my solutions to all 25 days (both parts for each, of course), run in less than 1 second total!! Repo: Reddit discussion (if you want to share your Nim experience with general AoC

Seems like a bug? SIGSEGV: Illegal storage access.

2021-01-02 Thread alexeypetrushin
Maybe we should say then - don't use function as "or" types, as it would make it hard to use it later. And using simple code like `fn((arg) => arg.hi())` won't be possible.

Cancelation points in async

2021-01-02 Thread arnetheduck
[chonos](https://github.com/status-im/nim-chronos/) supports cancellation, though in a slightly different way - you don't complete the future with `fail` \- you `cancel` it - using `fail` like that might be hard to reason about because you now have multiple "owners" fulfilling the promise.

arraymancer ``

2021-01-02 Thread Vindaar
First of all I'm happy to hear that `nimhdf5` works well to read NetCDF files! Slicing on tensors in arraymancer based on boolean conditionals was only added relatively recently. I assume that it's an oversight that there is no variant of `index_select` and similar (which `[x !=. 0.0]` calls), w