This is a creation in Article, where the information may have evolved or changed.
Speaking of the interface, this is a hurdle, some people may say, why go to write interface UI, this is not the part of Go good, nor go to do the thing, this sentence I do not love to listen to.
For example, we use the go language to write a server, this server is used as a live video chat server, its functions include live room online list personnel, of course, go language design, the server recorded the online list of userId, Roomid, token, level, IP, Chatconent and so on. For example, we have to monitor the list of people in a room to see if he uses the agreement to brush the popularity, in fact, is to count how many accounts on an IP, or whether there is a robot in the room to speak, and any time to ban it, or to count the number of online live list, etc. But can you remember so many orders?
And so many of the above things are shown in the black frame, the eyes have long been not tired? Once the command line is used wrong, assume the consequences?
In the command line to choose a user or room that is a very painful thing ah.
And these back-end administrators are not technicians, and are likely to make mistakes.
So the interface must be there.
The Go Language selection interface is a tangle of things, GitHub above Go-ui either project years no one updated, or simple function let people not look at one more.
For example, Google comes with Gxui has died, goqt download a lot of things to configure, GO-GTK configuration is also troublesome, and the function is simple.
If under Linux, I suggest or choose the next two, that is no choice.
In Winodws currently recommended Https://github.com/lxn/walk this thing, currently on GitHub on the latest version is required GO1.8 to build, otherwise hundred will be wrong.
Download below to see the demo
There are copy paste, data binding, picture display, WebKit, drawing, ListBox, Tray, tab, slider, drag file, progress bar, button, selection box, radio box, and so on. The function is quite comprehensive, can go to experiment under.
First to understand the next handle, what is called a handle? The handle can be said to be on the Windows collection all open Interface program on the same control ID, represents the unique identity, in fact, the bottom is the pointer, each time the program opened, the handle is randomly assigned by the system named, there is no two handle is the same. The handle contains the window handle and the control handle.
Walk downloaded the package is so small, and the compiled program is so small, it must be called the Windows built-in COM components and active controls, which exist in the DLL, usually located in the System32 directory or the program running under the current directory, Like QT5 These are not called Windows built-in, so QT-compiled programs cannot find a handle to a control. such as QQ, YY, thunder These software is unable to find the handle of the control, can only find the window handle, because these controls are DX draw out.
A handle is a numeric value similar to an integer.
When Windows design the interaction of different languages, DLL file is a hole that can not escape, first look at the different types of C + +, go definition
Win32/C + + Golang character comparison table
WIN32 Type C + + type GO type
HANDLE void * UIntPtr
byte unsigned char uint8, byte
Short Int16
WORD unsigned short uint16
int int int32, int
UINT unsigned int uint32
Long Long Int32
BOOL int int
DWORD unsigned long UInt32
ULONG unsigned long UInt32
Char Char Byte
WCHAR wchar_t UInt16
LPSTR Utf8/char * *byte
LPCSTR Const UTF8/CHAR * *byte, Syscall. Stringbyteptr (), XC. Utf8ptrtosting ()
LPWSTR wchar_t * *uint16
LPCWSTR Const wchar_t * *uint16, Syscall. Stringtoutf16ptr ()
float float float32
Double Double Float64
Longlong __int64 Int64
DWORD64 unsigned __int64 UInt64