Open fabricio-p opened 2 weeks ago
Sorry for not getting back to you sooner, been busy lately. Just pushed a version to fix some issues with Nim 2.0.6. However I see you use 2.1.1 which is an unstable development version. I can't reproduce your errors with the stable version, so I have to assume it's a bug in whatever development version you where using. I also tried your code and apart from some typos it also seems to have some logic errors. Below is my updated version which works fine:
import wxnim/[wx, genui]
var cbChoices = @["Combobox 1", "Combobox 2", "Combobox 3"]
var
spinner: ptr WxSpinCtrl
slider: ptr WxSlider
gauge: ptr WxGauge
proc spinnerCallback(e: var WxSpinEvent) {.cdecl.} =
let val = e.getPosition()
spinner.setValue(val)
gauge.setValue(val)
genui:
mainFrame % Frame(title = "Hello world") | Boxsizer(orient = wxVertical):
Panel | Boxsizer(orient = wxHorizontal):
StaticBox(label = "Basic controls")[proportion = 1] | StaticBoxSizer(orient = wxVertical):
Button: "Button"
CheckBox: "Checkbox"
TextCtrl(value = "Entry")
StaticText: "Label"
mainFrame.show()
runMainLoop()
The code sample is a subset of the example here https://github.com/PMunch/wxnim/blob/master/examples/genuimacro/controlgallery.nim
Yes I recognized the code. But when I now full the latest version of this repo it builds fine with the latest Nim version. So I'm unable to reproduce your issue. Did you try to upgrade to the latest stable Nim version and the latest version of wxnim? Keep in mind that old versions still in .nimble/pkgs
might override those in .nimble/pkgs2
, so best delete the entire old package cache.
I have only ~/.nimble/pkgs2
. Are you trying to cross-compile it from linux using mingw toolchain?
Basic information
build machine:
target machine:
nim --version
:Steps taken
nimble init project-name && cd project-name
nimble install wxnim
echo 'requires "wxnim#head"' >> project-name.nims
nvim src/project-name.nim
and writenvim config.nims
and writeMinGW-w64 8.1
label forx86_64
. The headers from https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.5/wxWidgets-3.2.5-headers.7z and the libraries from https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.5/wxMSW-3.2.5_gcc810_x64_ReleaseDLL.7zmkdir wxwidgets-mingw
and unzip the downloaded archives into that directory.nimble build
nim_dbg cpp src/project-name.nim
--define:"windows"
toconfig.nims
nimble build