govcl

module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: Apache-2.0

README

A cross-platform Golang GUI library. Use Delphi VCL and Lazarus LCL for binding.


The 1.2.0 version begins with govcl with a minimum requirement of go1.9.

License Minimum Go version Screenshots

Support Platform
Note: linux and macOS only part of the components, properties, events and methods are valid.

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

Librarys binaries
Librarys
Note: The "libvcl" library binary (libvcl. dll, libvclx64. dll) contained in the compression package is only for preview and test purposes. Please compile the "libvcl" source code for official use. please refer to the instructions in UILIbSrcources.

res2go Tool
res2go
Note: Designed in Delphi/Lazarus, code written in Golang.

usage:

go get github.com/ying32/govcl

  • Method 1:
package main

import (
   "github.com/ying32/govcl/vcl"
)

func main() {
    vcl.Application.Initialize()
    mainForm := vcl.Application.CreateForm()
    mainForm.SetCaption("Hello")
    mainForm.EnabledMaximize(false)
    mainForm.ScreenCenter()
    btn := vcl.NewButton(mainForm)
    btn.SetParent(mainForm)
    btn.SetCaption("Hello")
    btn.SetOnClick(func(sender vcl.IObject) {
        vcl.ShowMessage("Hello!")
    })
    vcl.Application.Run()
}
  • Method 2:
package main


import (
   "github.com/ying32/govcl/vcl"
)

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

var (
    mainForm *TMainForm
)

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


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

func (f *TMainForm) OnButtonClick(sender vcl.IObject) {
    vcl.ShowMessage("Hello!")
}

  • Method 3:
package main


import (
   "github.com/ying32/govcl/vcl"
)

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

var (
    mainForm *TMainForm
)

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


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

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

Method 3 needs to be used in conjunction with the UI designer or the res2go tool.


FAQ

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


Note:

When using the "liblcl" library, it is run in a compatible "libvcl" library, so some methods and properties of components and components are not available.


API document


  • Windows: Copy "libvcl.dll" or "libvclx64.dll" or "liblcl.dll" to the current exe directory or system environment path.

  • Linux: Copy the "liblcl.so" executable directory (you can also copy liblcl.so to the /usr/lib/ directory and use it as a public library).

  • MacOS: Copy the "liblcl.dylib" executable directory (Note for MacOS: you need to create the info.plist file yourself), or refer to: App packaging on MacOS


Directories

Path Synopsis
samples
SkinsharpTest
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
basicResForm
由GOVCL UI设计器自动生成,不要编辑 由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑 由GOVCL UI设计器自动生成,不要编辑。
formEvents
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
gdiplustest
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
gdiplustest2
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
govcl
govcl project main.go go.exe build -i -ldflags="-H windowsgui"
govcl project main.go go.exe build -i -ldflags="-H windowsgui"
imageviewer
由GOVCL UI设计器自动生成,不要编辑
由GOVCL UI设计器自动生成,不要编辑
listviewcustomdraw
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
login
由GOVCL UI设计器自动生成,不要编辑 由GOVCL UI设计器自动生成,不要编辑
由GOVCL UI设计器自动生成,不要编辑 由GOVCL UI设计器自动生成,不要编辑
miniwebview
由GOVCL UI设计器自动生成,不要编辑
由GOVCL UI设计器自动生成,不要编辑
mp3Player
由GOVCL UI设计器自动生成,不要编辑
由GOVCL UI设计器自动生成,不要编辑
multilanguage
由GOVCL UI设计器自动生成,不要编辑
由GOVCL UI设计器自动生成,不要编辑
notepad
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
res2goTest/Delphi/gocode
由res2go自动生成,不要编辑。
由res2go自动生成,不要编辑。
res2goTest/Lazarus/gocode
由res2go自动生成,不要编辑。
由res2go自动生成,不要编辑。
windowsspy
由GOVCL UI设计器自动生成,不要编辑
由GOVCL UI设计器自动生成,不要编辑
xunleidownloader
由GOVCL UI设计器自动生成,不要编辑。
由GOVCL UI设计器自动生成,不要编辑。
vcl
api
---------------------------------------- 加载文件或者内存中的窗口资源文件功能 需要配合窗口设计器使用 Copyright © ying32.
---------------------------------------- 加载文件或者内存中的窗口资源文件功能 需要配合窗口设计器使用 Copyright © ying32.
exts/skinh
skinsharp皮肤扩展接口 http://www.skinsharp.com/htdocs/index.htm skinsharp是收费的,这里只是头文件的导入。
skinsharp皮肤扩展接口 http://www.skinsharp.com/htdocs/index.htm skinsharp是收费的,这里只是头文件的导入。
rtl
win

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL