WxWidgets and Golang

I want to develop a program on Go with a multi-OS GUI on wxWidgets, my development environment is WinXP x86.

I wanted to use the wxWidgets Go wxGo shell , but the documentation is very succent, and the project seems dead from 2 years.

I ran into some errors with go get github.com/JeroenD/wxGo and go install github.com/JeroenD/wxGo

Result of go get github.com/JeroenD/wxGo :

 package github.com/JeroenD/wxGo imports github.com/JeroenD/wxGo imports github.com/JeroenD/wxGo: no Go source files in C:\Documents and Settings\dell\Mes documents\gopath\src\github.com\JeroenD\wxGo 

Result of go install github.com/JeroenD/wxGo :

 can't load package: package github.com/JeroenD/wxGo: no Go source files in C:\Documents and Settings\dell\Mes documents\gopath\src\github.com\JeroenD\wxGo 

I tried to follow the Building.txt document from JeroenD github. The first time I downloaded and installed wxWidgets, the code samples were able to compile (with MinGW), but I could not compile the wxWidgets library from the source code. The second time, I downloaded and installed wxPack with the libs / dll library already compiled. The problem here is that I cannot compile wxWidgets samples.

As stated in the Buiding.txt document from JeroenD github, I installed SWIGWIN but did not compile it from the source, since SWIG now supports Go (from the SWIG documentation). But now I do not know what to do with the wrapper (wxGo), wxWidgets dll / libs and SWIG. I think I read that SWIG needs * .i files to make the bindings from the language different, but I cannot find it in my wxWidgets folder, maybe I need to take these files from another wxWidgets binding (wxLua and wxPython have these repos).

My goal is to get wxWidgets lib to work with Go in order to be able to write Multi OS GUI in wxWidgets, I am a little surprised that no one reported problems with the JeroenD package and did not want to get wxWidgets working with Go.

As you may ask, building a GUI GUI with go-gtk is not a solution, since in my project it is necessary to have an OS with several OS installed on it (if you have a GUI library with several OSs that looks native and easier to use, please tell me).

+4
source share
3 answers

wxGO wxWidgets wrapper for GO is here wxGO MultiOS

+1
source

According to the Building.txt file:

 To build the wxGo library: cd wx make install 

So, even though it's a Go package, it doesn't seem to use any real Go code (if you look at github.com/JeroenD/wxGo, you won't see any .go files).

I think in such cases you need to use git (instead of go get ) and make install instead of go install .

In windows, you may need to install Git for Windows to make this process a little easier.

Once it is created, it looks like you can use

 import "wx" 

as usual, in go code (minimal example at https://github.com/JeroenD/wxGo/blob/master/example/minimal/minimal.go )

+2
source

QML may be the best choice; it helps with wxWidget or QT underwear.

-2
source

Source: https://habr.com/ru/post/1491481/


All Articles