Cross-platform Go/Golang GUI library.

中文 | English


GoVCL

Cross-platform Golang GUI library, The core binding is liblcl, a common cross-platform GUI library created by Lazarus.

GoVCL is a native GUI library, not based on HTML, let alone DirectUI library, everything is practical.

Full name: Go Language Visual Component Library

govcl minimum requirement is go1.9.2.

Screenshots | WIKI(Chinese) | What's-new(Chinese) | Video tutorial(Unofficial) | Sponsor govcl


Support Platform

Windows | Linux | macOS

If you want to support linux arm and linux 32bit, you need to compile the corresponding liblcl binary.

Pre-compiled GUI library binary download (source code)

liblcl

res2go IDE plugin source code(source code

How to use: Installation method

Note: Designed in Lazarus, code written in Golang.

usage:

Step 1: Get the govcl code

go get -u github.com/ying32/govcl

Note: You can also use go module mode, configure in go.mod, such as: github.com/ying32/govcl v2.2.0+incompatible.

Step 2: Write the code

  • Method 1(Use Lazarus to design the GUI. recommend):
package main


import (
   // Do not reference this package if you use custom syso files
   _ "github.com/ying32/govcl/pkgs/winappres"
   "github.com/ying32/govcl/vcl"
)

type TMainForm struct {
    *vcl.TForm
    Btn1     *vcl.TButton
}

type TAboutForm struct {
    *vcl.TForm
    Btn1    *vcl.TButton
}

var (
    mainForm *TMainForm
    aboutForm *TAboutForm
)

func main() {
    vcl.Application.Initialize()
    vcl.Application.SetMainFormOnTaskBar(true)
    vcl.Application.CreateForm(&mainForm)
    vcl.Application.CreateForm(&aboutForm)
    vcl.Application.Run()
}

// -- TMainForm

func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
    
}

func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {
    aboutForm.Show()
}

// -- TAboutForm

func (f *TAboutForm) OnFormCreate(sender vcl.IObject) {
 
}

func (f *TAboutForm) OnBtn1Click(sender vcl.IObject) {
    vcl.ShowMessage("Hello!")
}

Method 1 needs to be used in conjunction with the res2go tool.

  • Method 2(Pure code, imitating the way of FreePascal class):
package main


import (
   // Do not reference this package if you use custom syso files
   _ "github.com/ying32/govcl/pkgs/winappres"
   "github.com/ying32/govcl/vcl"
)

type TMainForm struct {
    *vcl.TForm
    Btn1     *vcl.TButton
}

type TAboutForm struct {
    *vcl.TForm
    Btn1    *vcl.TButton
}

var (
    mainForm *TMainForm
    aboutForm *TAboutForm
)

func main() {
    vcl.RunApp(&mainForm, &aboutForm)
}

// -- TMainForm

func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
    f.SetCaption("MainForm")
    f.Btn1 = vcl.NewButton(f)
    f.Btn1.SetParent(f)
    f.Btn1.SetBounds(10, 10, 88, 28)
    f.Btn1.SetCaption("Button1")
    f.Btn1.SetOnClick(f.OnBtn1Click)  
}

func (f *TMainForm) OnBtn1Click(sender vcl.IObject) {
    aboutForm.Show()
}


// -- TAboutForm

func (f *TAboutForm) OnFormCreate(sender vcl.IObject) {
    f.SetCaption("About")
    f.Btn1 = vcl.NewButton(f)
    //f.Btn1.SetName("Btn1")
    f.Btn1.SetParent(f)
    f.Btn1.SetBounds(10, 10, 88, 28)
    f.Btn1.SetCaption("Button1")
    f.Btn1.SetOnClick(f.OnBtn1Click)  
}

func (f *TAboutForm) OnBtn1Click(sender vcl.IObject) {
    vcl.ShowMessage("Hello!")
}

Step 3: Copy the corresponding binary

  • Windows: Depending on whether the compiled binary is 32 or 64 bits, copy the corresponding liblcl.dll to the current executable file directory or system environment path.

    • Go environment variable: GOARCH = amd64 386 GOOS = windows CGO_ENABLED=0
  • Linux: Copy liblcl.so under the current executable file directory (you can also copy liblcl.so to /usr/lib/ (32bit liblcl) or /usr/lib/x86_64-linux-gnu/ (64bit liblcl) directory , Used as a public library).

    • Go environment variable: GOARCH = amd64 GOOS = linux CGO_ENABLED=1
  • MacOS: Copy liblcl.dylib to the current executable file directory (note under MacOS: you need to create info.plist file yourself), or refer to: App packaging on MacOS

    • Go environment variable: GOARCH = amd64 GOOS = darwin CGO_ENABLED=1

Note: The "current executable file directory" here refers to the location of the executable file generated by your currently compiled project.


Special Note: All UI components are non-threaded/non-coroutine safe. When used in goroutine, use vcl.ThreadSync to synchronize updates to the UI.

Special Note 2: If you use go>=1.15 to compile Windows executable files, you must use the -buildmode=exe compilation option, otherwise there will be errors.


FAQ

Q: Why is there no English WIKI?
A: My English is bad. You can try using Google Translate Chinese WIKI.


API document


jetbrains
Thanks jetbrains

Owner
不在乎y
洗洗睡吧,梦里什么都有。
不在乎y
Comments
  • Difficulties in getting it to work on macOS

    Difficulties in getting it to work on macOS

    Hello, As someone with 20 year's experience of Delphi (and more recently Free Pascal/Lazarus) and also a Golang user for the last year, I am naturally very interested in this project.

    However, I am having difficulties following the exact steps needed to run it on macOS. Could you set out some step by step instructions that would guarantee that I would be able to build and install this package?

    I realise and appreciate that English is not your native language, but at the moment there are too many missing gaps in the instructions, which leaves too much to guesswork.

    If you can do this for me, I will definitely do all I can to promote it!

    Thanks in advance, Carl

  • 再请教下ui的问题。

    再请教下ui的问题。

    [ diff 我试着用govcl 学习仿照了个登录界面。基本功能都能实现. 细节处还是有差异,有几个问题不知道是从lazarus里还是代码里解决.请大佬赐教. 1: 现在窗口有1像素的白色边框,能否设置颜色. 2:窗口可以设置圆角吗. 3: 图片实现的按钮能否在鼠标悬浮和点击后改变样式.

    感谢.govcl牛x.

  • MacOS with M1 lots of errors

    MacOS with M1 lots of errors

    So I've downloaded the "Pre-compiled GUI library binary download" and extracted the "macOS64-cocoa" version of "liblcl.dylib" to the directory where my go-software is. When I try to run it, this is what I get:

    ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000003.o) was built for newer macOS version (12.0) than being linked (11.0) ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000005.o) was built for newer macOS version (12.0) than being linked (11.0) ld: warning: ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000007.o) was built for newer macOS version (12.0) than being linked (11.0) object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000004.o) was built for newer macOS version (12.0) than being linked (11.0) ld: warning: ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000010.o) was built for newer macOS version (12.0) than being linked (11.0)ld: warning: ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000002.o) was built for newer macOS version (12.0) than being linked (11.0)ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000012.o) was built for newer macOS version (12.0) than being linked (11.0) ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000011.o) was built for newer macOS version (12.0) than being linked (11.0) object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000009.o) was built for newer macOS version (12.0) than being linked (11.0) ld: warning: object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000006.o) was built for newer macOS version (12.0) than being linked (11.0) object file (/var/folders/2j/sl_kv1311vggqj0m8jy3_w7w0000gn/T/go-link-3205247113/000008.o) was built for newer macOS version (12.0) than being linked (11.0) dlopen err: dlopen(/Users/marcelloh/data/go-private/WiMaLiCommander/liblcl.dylib, 0x0009): tried: '/Users/marcelloh/data/go-private/WiMaLiCommander/liblcl.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))) panic: dlopen("liblcl.dylib"), failed.

    goroutine 1 [running]: github.com/ying32/govcl/vcl/api.loadUILib() /Users/marcelloh/data/go-private/WiMaLiCommander/vendor/github.com/ying32/govcl/vcl/api/dylib_nonmemory.go:32 +0xe4 github.com/ying32/govcl/vcl/api.init() /Users/marcelloh/data/go-private/WiMaLiCommander/vendor/github.com/ying32/govcl/vcl/api/dylib.go:24 +0x148 exit status 2

  • MacOS下TEdit.Text()不能正确返回中文

    MacOS下TEdit.Text()不能正确返回中文

    MacOS v10.15.1 Go: 1.13.4 darwin/amd64 FPC: 3.0.4 LazarusIDE: 2.0.6 使用 MacOS 64bit编译

    代码很简单,一个文本框,一个按钮,一个标签,如下。

    type TForm1 struct {
        *vcl.TForm
        EdtName   *vcl.TEdit
        BtnSay    *vcl.TButton
        LbName    *vcl.TStaticText
        MainMenu1 *vcl.TMainMenu
    
        //::private::
        TForm1Fields
    }
    
    func (f *TForm1) OnBtnSayClick(sender vcl.IObject) {
    	f.LbName3.SetCaption(fmt.Sprintf("Hello! %s", f.EdtName.Text()))
    }
    

    如果在文本框输入中文,点击两次按钮程序直接崩溃,错误日志如下

    LoadLibrary: liblcl.dylib
    IsloadedLcl: true
    2019-12-11 16:29:09.973 gocode[43323:569442] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:errorDescription:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.10.126/AppKit.subproj/NSCell.m:1417
    2019-12-11 16:29:09.976 gocode[43323:569442] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil'
    *** First throw call stack:
    (
            0   CoreFoundation                      0x00007fff3395bf53 __exceptionPreprocess + 250
            1   libobjc.A.dylib                     0x00007fff69a21835 objc_exception_throw + 48
            2   CoreFoundation                      0x00007fff33977810 +[NSException raise:format:arguments:] + 88
            3   Foundation                          0x00007fff360575d1 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
            4   AppKit                              0x00007fff30b3a022 -[NSCell _objectValue:forString:errorDescription:] + 300
            5   AppKit                              0x00007fff30b39e4d -[NSCell setStringValue:] + 41
            6   AppKit                              0x00007fff30b8a7c9 -[NSControl setStringValue:] + 210
            7   liblcl.dylib                        0x0000000007ba7034 ControlScrollBar_StaticClassType + 2201044
            8   liblcl.dylib                        0x0000000007a3994f ControlScrollBar_StaticClassType + 704239
            9   liblcl.dylib                        0x0000000007a3fc8f ControlScrollBar_StaticClassType + 729647
            10  liblcl.dylib                        0x00000000079f450e ControlScrollBar_StaticClassType + 420526
            11  liblcl.dylib                        0x0000000007a4cb9b ControlScrollBar_StaticClassType + 782651
            12  liblcl.dylib                        0x000000000791ebf1 liblcl.dylib + 125937
            13  gocode                              0x0000000004300367 _cgo_1e7a236d0efc_Cfunc_Syscall4 + 39
            14  gocode                              0x0000000004058600 runtime.asmcgocall + 112
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    SIGABRT: abort
    PC=0x7fff6aed349a m=0 sigcode=0
    signal arrived during cgo execution
    
    goroutine 1 [syscall, locked to thread]:
    runtime.cgocall(0x4300340, 0xc000156798, 0x7e9d7b0)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/cgocall.go:128 +0x5b fp=0xc000156768 sp=0xc000156730 pc=0x400488b
    github.com/ying32/govcl/vcl/dylib._Cfunc_Syscall4(0x7977478, 0x797c478, 0x2, 0x7e9eff0, 0xc000174030, 0x0)
            _cgo_gotypes.go:199 +0x4e fp=0xc000156798 sp=0xc000156768 pc=0x40d2c1e
    github.com/ying32/govcl/vcl/dylib.(*LazyProc).CallOriginal.func5(0xc00008e180, 0xc000156908, 0x4, 0x4, 0x3)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:287 +0x18b fp=0xc000156800 sp=0xc000156798 pc=0x40d5d6b
    github.com/ying32/govcl/vcl/dylib.(*LazyProc).CallOriginal(0xc00008e180, 0xc000156908, 0x4, 0x4, 0x3, 0x3, 0x4, 0x0)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:287 +0x133 fp=0xc000156878 sp=0xc000156800 pc=0x40d51f3
    github.com/ying32/govcl/vcl/dylib.(*LazyDLL).call(0xc0000220c0, 0xc0000c25a0, 0xc000156c88, 0x2, 0x2, 0x20, 0x46791a0, 0x4356b20, 0xc000178000)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:207 +0x1ba fp=0xc000156c30 sp=0xc000156878 pc=0x40d400a
    github.com/ying32/govcl/vcl/dylib.(*LazyProc).Call(...)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:267
    github.com/ying32/govcl/vcl/api.StaticText_SetCaption(0x7e9eff0, 0xc000174020, 0xb)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/api/importFuncsAuto.go:14894 +0x8d fp=0xc000156ce0 sp=0xc000156c30 pc=0x40fb6ed
    github.com/ying32/govcl/vcl.(*TStaticText).SetCaption(...)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/statictext.go:562
    main.(*TForm1).OnBtnSayClick(0xc00014b140, 0x4404280, 0xc00016cf40)
            /Users/allendang/Desktop/vlctest/gocode/Form1Impl.go:17 +0xcd fp=0xc000156d40 sp=0xc000156ce0 pc=0x42f71dd
    runtime.call32(0xc00014b6b0, 0xc000011248, 0xc00016cf20, 0x1800000018)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/asm_amd64.s:539 +0x3b fp=0xc000156d70 sp=0xc000156d40 pc=0x405716b
    reflect.callMethod(0xc000022180, 0xc000156e50, 0xc000156e38)
            /usr/local/Cellar/go/1.13.4/libexec/src/reflect/value.go:714 +0x1f0 fp=0xc000156e20 sp=0xc000156d70 pc=0x407eda0
    reflect.methodValueCall(0x4404280, 0xc00016cf40, 0xc000157438, 0x4331560, 0xc000022180, 0x4035d01, 0x4005a55, 0xc000156ec8, 0x4035f8f, 0xc000024000, ...)
            /usr/local/Cellar/go/1.13.4/libexec/src/reflect/asm_amd64.s:35 +0x42 fp=0xc000156e50 sp=0xc000156e20 pc=0x40879d2
    github.com/ying32/govcl/vcl.eventCallbackProc(0x98222819, 0x7ffeefbfd950, 0x1, 0xc000157810)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/callbackevent.go:50 +0x3b8 fp=0xc0001577a8 sp=0xc000156e50 pc=0x4293418
    github.com/ying32/govcl/vcl.doEventCallbackProc(...)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/callback_posix.go:28
    github.com/ying32/govcl/vcl._cgoexpwrap_7521bf8818ec_doEventCallbackProc(0x98222819, 0x7ffeefbfd950, 0x1, 0x0)
            _cgo_gotypes.go:86 +0x82 fp=0xc000157810 sp=0xc0001577a8 pc=0x42eb8c2
    runtime.call32(0x0, 0x7ffeefbfd7d0, 0x7ffeefbfd860, 0x20)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/asm_amd64.s:539 +0x3b fp=0xc000157840 sp=0xc000157810 pc=0x405716b
    runtime.cgocallbackg1(0x0)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/cgocall.go:314 +0x1b7 fp=0xc000157928 sp=0xc000157840 pc=0x4004c37
    runtime.cgocallbackg(0x0)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/cgocall.go:191 +0xc1 fp=0xc000157990 sp=0xc000157928 pc=0x40049e1
    runtime.cgocallback_gofunc(0x40048af, 0x4300300, 0xc000157a20, 0xc000157a10)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/asm_amd64.s:793 +0x9b fp=0xc0001579b0 sp=0xc000157990 pc=0x405873b
    runtime.asmcgocall(0x4300300, 0xc000157a20)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/asm_amd64.s:640 +0x42 fp=0xc0001579b8 sp=0xc0001579b0 pc=0x40585d2
    runtime.cgocall(0x4300300, 0xc000157a20, 0xc000157ae0)
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/cgocall.go:131 +0x7f fp=0xc0001579f0 sp=0xc0001579b8 pc=0x40048af
    github.com/ying32/govcl/vcl/dylib._Cfunc_Syscall3(0x7977478, 0x79774a8, 0x1, 0x7e988f0, 0x0)
            _cgo_gotypes.go:183 +0x4e fp=0xc000157a20 sp=0xc0001579f0 pc=0x40d2b2e
    github.com/ying32/govcl/vcl/dylib.(*LazyProc).CallOriginal.func4(0xc00008e180, 0xc000157b68, 0x3, 0x3, 0x8)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:285 +0x143 fp=0xc000157a78 sp=0xc000157a20 pc=0x40d5ba3
    github.com/ying32/govcl/vcl/dylib.(*LazyProc).CallOriginal(0xc00008e180, 0xc000157b68, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:285 +0x197 fp=0xc000157af0 sp=0xc000157a78 pc=0x40d5257
    github.com/ying32/govcl/vcl/dylib.(*LazyDLL).call(0xc0000220c0, 0xc00014a270, 0xc000157ef0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:205 +0x100 fp=0xc000157ea8 sp=0xc000157af0 pc=0x40d3f50
    github.com/ying32/govcl/vcl/dylib.(*LazyProc).Call(...)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/dylib/dylib_posix.go:267
    github.com/ying32/govcl/vcl/api.Application_Run(0x7e988f0)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/api/applicationdef.go:14 +0x65 fp=0xc000157f08 sp=0xc000157ea8 pc=0x40d7ea5
    github.com/ying32/govcl/vcl.(*TApplication).Run(...)
            /Users/allendang/Documents/Gocode/src/github.com/ying32/govcl/vcl/applicationdef.go:86
    main.main()
            /Users/allendang/Desktop/vlctest/gocode/main.go:12 +0xd8 fp=0xc000157f60 sp=0xc000157f08 pc=0x42f72d8
    runtime.main()
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/proc.go:203 +0x21e fp=0xc000157fe0 sp=0xc000157f60 pc=0x402ec0e
    runtime.goexit()
            /usr/local/Cellar/go/1.13.4/libexec/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000157fe8 sp=0xc000157fe0 pc=0x4058e61
    
    rax    0x0
    rbx    0xc676dc0
    rcx    0x7ffeefbfb8b8
    rdx    0x0
    rdi    0x307
    rsi    0x6
    rbp    0x7ffeefbfb8e0
    rsp    0x7ffeefbfb8b8
    r8     0x7ffeefbfb780
    r9     0x7ffeefbfb950
    r10    0x0
    r11    0x246
    r12    0x307
    r13    0x3000000008
    r14    0x6
    r15    0x16
    rip    0x7fff6aed349a
    rflags 0x246
    cs     0x7
    fs     0x0
    gs     0x0
    WARNING: TButton.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?
    
  • 自己定义的Struct怎么释放

    自己定义的Struct怎么释放

    伪代码:

    type Test struct {
    	*vcl.TPanel
    	label1 *vcl.TLabel
    	label2  *vcl.TLabel
    }
    
    
    func NewTest(owner vcl.IComponent) *Test {
    	tt := new(Test)
    	tt.TPanel = vcl.NewPanel(owner)
        
    	tt.label1 = vcl.NewLabel(tt)
    	tt.label1.SetParent(tt)
        
    	tt.label2 = vcl.NewLabel(tt)
    	tt.label2.SetParent(tt)
    	return tt
    }
    
    func (tt *Test) Free() {
    	tt.label1.Free()
    	tt.label2.Free()
    	tt.TPanel.Free()
    }
    

    执行Free()报错 image

  • Panic goroutine

    Panic goroutine

    
    import (
    	"github.com/ying32/govcl/vcl"
    )
    
    var (
    	mainForm *vcl.TForm
    )
    
    func main() {
    	vcl.Application.Initialize()
    	mainForm = vcl.Application.CreateForm()
    	mainForm.SetCaption("Hello")
    	mainForm.ScreenCenter()
    
    	Btn1 := vcl.NewButton(mainForm)
    	Btn1.SetParent(mainForm)
    	Btn1.SetBounds(10, 10, 88, 28)
    	Btn1.SetCaption("Button1")
    	Btn1.SetOnClick(func(sender vcl.IObject) {
    		go func() {
    			vcl.ShowMessage("Hello!")
    		}()
    	})
    
    	vcl.Application.Run()
    }
    
    > fatal error: unexpected signal during runtime execution
    > [signal SIGSEGV: segmentation violation code=0x1 addr=0x84 pc=0x7fe1064fdea4]
  • 如何能在Edit的SetText中设置自动换行?

    如何能在Edit的SetText中设置自动换行?

    您好 我在使用过程中,使用如下代码

    f.EditWords = vcl.NewEdit(f)
    f.EditWords.SetParent(f)
    f.EditWords.SetAutoSize(false)
    f.EditWords.SetBounds(20, 40, 360, 200)
    ```
    创建了Edit后,通过SetText设置文本,发现如果输出超过Edit width的文本,并不能在Edit里自动换行,哪怕在文本里插入\n也不行
    这个有什么好的解决办法嘛
    感谢
  • 如果想要不断的显示新的图像,应该用哪个组件比较合适啊

    如果想要不断的显示新的图像,应该用哪个组件比较合适啊

    我现在使用的是 f1, _ := os.Open("3.bmp") defer f1.Close() img1, _ := ioutil.ReadAll(f1) f.img = vcl.NewImage(f) f.img.SetAutoSize(true) mem1 := vcl.NewMemoryStream() defer mem1.Free() mem1.Write(img1) mem1.SetPosition(0) f.img.Picture().LoadFromStream(mem1) f.img.SetParent(f)

    f.img.SetOnClick(func(sender vcl.IObject) { ------changeImg(f) }) //////////////////// func changeImg(f *TMainForm) { ------fmt.Println("change img") ------f1, _ := os.Open("3.bmp") ------f2, _ := os.Open("4.bmp") ------defer f1.Close() ------defer f2.Close() ------img1, _ := ioutil.ReadAll(f1) ------img2, _ := ioutil.ReadAll(f2) ------mainForm.img = vcl.NewImage(f) ------mainForm.img.SetAutoSize(true) ------mem1 := vcl.NewMemoryStream() ------defer mem1.Free() ------mem1.Write(img1) ------mem1.SetPosition(0) ------mem2 := vcl.NewMemoryStream() ------defer mem2.Free() ------mem2.Write(img2) ------mem2.SetPosition(0) ------mainForm.img.Picture().LoadFromStream(mem1) ------for i:=0; i<10;i++{ ------------fmt.Println("load img ...", i) ------------if i%2==0{ ------------------mainForm.img.Picture().LoadFromStream(mem1) ------------}else{ ------------------mainForm.img.Picture().LoadFromStream(mem2) ------------} ------} } 但是发现后续不能修改图像,会报错unknown picture format

  • why VCL and not focusing only on LCL ?

    why VCL and not focusing only on LCL ?

    Hello, no problem here, I'm just curious to know why you don't focus only on supporting LCL, which is free and cross-platform and still keep supporting VCL which is not cross-platform and mostly not really free (except for open source development if I understand well). so you have to be compatible with both of them and restrict the functions to what is common between them... is VCL really better or does it have some specials possibilities that could justify to keep supporting it ?

    please just consider my question as the expression of my curiosity, I do not want to blame you for anything. you have made a really great work with govcl, thanks for that !!

  • error when updating package

    error when updating package

    go get -u ./...

    github.com/ying32/govcl/vcl/api

    ../../../go/pkg/mod/github.com/ying32/[email protected]+incompatible/vcl/api/importFuncsAuto.go:392:53: undefined: TMessage

    when I do "normal" way:: go get -u github.com/ying32/govcl no complaints until I run the example: vendor/github.com/ying32/govcl/vcl/api/importFuncsAuto.go:392:53: undefined: TMessage

  • TStringList无法获取插入的Object

    TStringList无法获取插入的Object

    调用TStringList的AddObject方法插入对象后,再调用Objects方法获取刚才插入的对象,返回值为空,测试代码:

    package main

    import ( "gitee.com/ying32/govcl/vcl" "unsafe" )

    type Person struct { Name string }

    func main() { p1 := &Person{} p1.Name = "Tom"

    strList := vcl.NewStringList()
    strList.AddObject("item1", vcl.ObjectFromInst(uintptr(unsafe.Pointer(&p1))))
    
    
    item1 := (* Person)(unsafe.Pointer(strList.Objects(0)))
    println("Name = " + item1.Name)
    

    }

Cross platform GUI in Go based on Material Design
Cross platform GUI in Go based on Material Design

About Fyne is an easy to use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a

Jan 3, 2023
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Thanks to go-astilectron build cross platform GUI apps with GO and HTML/JS/CSS. It is the official GO bindings of astilectron and is powered by Electr

Jan 9, 2023
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

gowd Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs) How to use this library: Download and install nwjs Install this library g

Dec 11, 2022
RobotGo, Go Native cross-platform GUI automation @vcaesar

Robotgo Golang Desktop Automation. Control the mouse, keyboard, bitmap, read the screen, Window Handle and global event listener. RobotGo supports Mac

Jan 7, 2023
Cross-platform GUI for go is never this easy and clean.
Cross-platform GUI for go is never this easy and clean.

gimu Strongly suggest NOT to use this project anymore, the auto-generated cgo wrapper of Nuklear has a random crash issue which is hard to fix (becaus

Jul 12, 2022
Cross-Platform GUI Framework for Go

⚠️ I'm currently working on this project as part of my master's thesis at the Berlin University of Applied Sciences and Technology. It is under active

Oct 31, 2022
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase
Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Kita is a declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase. Inspired by Flutter, React. S

Apr 18, 2022
UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase
 UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

UIKit - A declarative, reactive GUI toolkit for build cross platform apps with web technology with single codebase

Apr 18, 2022
Platform-native GUI library for Go.

ui: platform-native GUI library for Go This is a library that aims to provide simple GUI software development in Go. It is based on my libui, a simple

Jan 9, 2023
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Dec 28, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

webview A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Ni

Jan 1, 2023
An experimental Go cross platform UI library.

GXUI - A Go cross platform UI library. Notice: Unfortunately due to a shortage of hours in a day, GXUI is no longer maintained. If you're looking for

Jan 6, 2023
Cross-platform Go library to place an icon in the host operating system's taskbar.

trayhost Package trayhost is a cross-platform Go library to place an icon in the host operating system's taskbar. Platform Support macOS - Fully imple

Nov 6, 2022
Go cross-platform library for displaying dialogs and input boxes

dlgs dlgs is a cross-platform library for displaying dialogs and input boxes. Installation go get -u github.com/gen2brain/dlgs Documentation Document

Dec 24, 2022
Windows GUI library for Go (Golang). Comes with a graphical UI designer.

Version 2 Please go to Version 2 of this library for the latest version. Windows GUI Library This is a pure Go library to create native Windows GUIs.

Jan 1, 2023
Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.
Golang bindings for XCGUI, Windows GUI library, DirectUI design idea.

XCGUI 项目文档 帮助文档 程序示例 介绍 English | 简体中文 DirectUI设计思想: 在窗口内没有子窗口,界面元素都是逻辑上的区域(无HWND句柄,安全,灵活), 所有UI元素都是自主开发(不受系统限制), 更加灵活的实现各种程序界面,满足不同用户的需求.

Dec 22, 2022
Build cross-platform modern desktop apps in Go + HTML5
Build cross-platform modern desktop apps in Go + HTML5

Lorca A very small library to build modern HTML5 desktop apps in Go. It uses Chrome browser as a UI layer. Unlike Electron it doesn't bundle Chrome in

Jan 6, 2023
A cross-platform app-development module for Go.
A cross-platform app-development module for Go.

The cross-platform Go module for building apps (pronounced klo-va-seed). Usecases As a lightweight alternative to Electron Write your frontend and nat

Dec 1, 2022
pure go, cross-platform, MIT-licensed ui toolkit for developers
pure go, cross-platform, MIT-licensed ui toolkit for developers

duit - developer ui toolkit WARNING: this library is work in progress. backwards incompatible changes will be made. details duit is a pure go (*), cro

Dec 24, 2022