Git Product home page Git Product logo

govcl's Introduction

中文 | 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.


Because GoVCL has already entered a stable stage and is currently in a state of pure maintenance. Under normal circumstances, no new features or components will be added. If there are no bugs that need to be fixed (referring to the bugs in govcl), in principle, a new version will not be released. 2023/11/20


Screenshots | WIKI(Chinese) | What's-new(Chinese)


Ⅰ. 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

Ⅲ. UI Designer(Two options)

  • 1、 Easy UI designer (single-page design, suitable for those who do not want to install Lazarus, and the project is not too complicated)

GoVCLDesigner.win

Note: This UI designer is no longer updated, but it does not affect use.

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.3+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

govcl's People

Contributors

dshumko avatar isyscore avatar raochq avatar ying32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

govcl's Issues

支持设置lib库加载目录

目前lib库的目录是写死的,只能在当前主程序根目录,是否可以让应用自己设置目录?这样程序的目录规划更灵活

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

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]

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)

}

Failed to load liblcl.dll: The specified module could not be found.

GoVCL looks like it is exactly what I was looking for if I can get it to work with Res2Go. I only get this error when using Res2Go to create the forms, otherwise the DLL is found with no problem. If I create a go project without using Res2Go, the DLL is loaded. If I put the liblcl.dll in your formEvents example project (where forms were created using your GOVCL UI designer) and run it, it works fine. But if I run Res2Go myself and put the DLL with the generated files, I get that error.

Any ideas? :-)

res2go 支持自定义模块名

有的时候ui程序不一定是 main 包主程序,是否可以让 res2go 增加 -module 参数,用户指定生成的go文件的模块名?

Further code changes to my test program

Hello again, I've been making further changes to my code. The state of play is that the code works if the AddListBox is commented out but doesn't work if it is included. Any ideas what I am doing wrong?

package main

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

var (
	mainForm *vcl.TForm
)

// ControlType is the variable used as an enum
type ControlType int

// This is an enum representing the control type
const (
	Label ControlType = 1 + iota
	Button
	ListBox
)

// Rect represents the bounds of a TControl
type Rect struct {
	left, top, width, height int32
}

func main() {
	vcl.Application.Initialize()
	mainForm = vcl.Application.CreateForm()
	mainForm.SetCaption("Hello to you!!")
	mainForm.ScreenCenter()
	AddLabel(mainForm, Rect{10, 10, 100, 22}, "A functional label!")
	AddButton(mainForm, Rect{10, 40, 100, 20}, "Click Me!")
	// The code work if the following line is commented out, but not if it is included...
	AddListbox(mainForm, Rect{10, 70, 200, 200}, []string{"Alpha", "Beta", "Gamma"})
	vcl.Application.Run()
}

// ControlWrapper wraps an IControl
type ControlWrapper struct {
	control vcl.IControl
}

// SetProperties combines the SetParent, SetBounds and SetCaption functions
func (wrapper ControlWrapper) SetProperties(parent vcl.IWinControl, rect Rect, caption string) {
	wrapper.control.SetParent(parent)
	wrapper.control.SetBounds(rect.left, rect.top, rect.width, rect.height)
	wrapper.control.SetCaption(caption)
}

// AddLabel adds a new Label
func AddLabel(parent vcl.IWinControl, rect Rect, caption string) *vcl.TLabel {
	wrapper := ControlWrapper{CreateControl(parent, Label)}
	wrapper.SetProperties(parent, rect, caption)
	return wrapper.control.(*vcl.TLabel)
}

// AddButton adds a new button
func AddButton(parent vcl.IWinControl, rect Rect, caption string) *vcl.TButton {
	wrapper := ControlWrapper{CreateControl(parent, Button)}
	wrapper.SetProperties(parent, rect, caption)
	return wrapper.control.(*vcl.TButton)
}

// AddListbox adds a new ListBox
func AddListbox(parent vcl.IWinControl, rect Rect, items []string) *vcl.TListBox {
	wrapper := ControlWrapper{CreateControl(parent, ListBox)}
	wrapper.SetProperties(parent, rect, "")
	for _, item := range items {
		wrapper.control.(*vcl.TListBox).Items().Add(item)
	}
	return wrapper.control.(*vcl.TListBox)
}

// CreateControl is a "Generic" factory method for Control creation
func CreateControl(owner vcl.IComponent, controlType ControlType) vcl.IControl {
	switch controlType {
	case Label:
		return vcl.NewLabel(owner)
	case Button:
		return vcl.NewButton(owner)
	case ListBox:
		return vcl.NewListBox(owner)
	default:
		return nil
	}
}

rtl.SysOpen

无法打开二级目录

Win:
rtl.SysOpen("F:\") 可以打开
rtl.SysOpen("F:\filename\") 不可以打开

How complex would be to redesign yours project so it would be also usable for Pascal for Android development?

If I have correctly understood The provided little example in readme, yours GUI toolkit do not require pixel values as mandatory argument when user want to create application GUI.
This would be A ideal solution for visually impaired Pascal programmer. The good question is, if this toolkit can be also used when somebody would want to develop for Android? If not, would be possible to develop Windows apps with yours project?
Thank you very much for yours explanation.
I do not see at all, so modern form designers are not usable for Me. And pixel values, which are often being generated by various IDES according to object mouse positions when sighted developer design it are not usable for Me. Since I can not specify good Pixel values because I do not see.

增加例程需求

可以在此issue下提出你想增加的例程需求,我会根据所提出的例程视情况采纳。
1、不要太过于复杂的需求。
2、不要超出govcl范围。
3、不要提一些不可能实现的需求。

Use of SetCaption()

Hello, in the same way, that we can use SetBounds() for any variable reference that implements IControl, is there a way of calling SetCaption()?

This is my code, at the moment. I am gradually refactoring it to make as much common code as possible...

package main

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

var (
	mainForm *vcl.TForm
)

// ControlType is the variable used as an enum
type ControlType int

const (
	Label ControlType = 1 + iota
	Button
)

type Form struct {
	*vcl.TForm
}

func main() {
	vcl.Application.Initialize()
	mainForm = vcl.Application.CreateForm()
	mainForm.SetCaption("Hello to you!!")
	mainForm.ScreenCenter()
	AddLabel(mainForm, mainForm, 10, 10, 100, 22, "A functional label!")
	AddButton(mainForm, mainForm, 10, 40, 40, 20, "Click Me!")
	vcl.Application.Run()
}

// AddLabel adds a new Label
func AddLabel(owner vcl.IComponent, parent vcl.IWinControl, left int32, top int32, width int32, height int32, caption string) (*vcl.TLabel) {
	label := CreateControl(owner, Label)
	label.SetParent(parent)
	label.SetBounds(left, top, width, height)
	label.SetCaption(caption)
	return label
}

// AddButton adds a new button
func AddButton(owner vcl.IComponent, parent vcl.IWinControl, left int32, top int32, width int32, height int32, caption string) (*vcl.TButton) {
	button := CreateControl(owner, Button)
	button.SetParent(parent)
	button.SetBounds(left, top, width, height)
	button.SetCaption(caption)
	return button
}

// CreateControl is a "Generic" factory method for Control creation
func CreateControl(owner vcl.IComponent, controlType ControlType) (vcl.IWinControl) {
	switch controlType {
	case Label:
		return vcl.NewLabel(owner)
	case Button:
		return vcl.NewButton(owner)
	default:
		return nil
	}
}

At the moment it is falling down on the calls to SetCaption because there doesn't seem to be an "ancestor" interface that I can use that is common to TLabel and TButton.

Is it possible to change LGPL to more permissive license ?

Hi @ying32, thanks for this awesome library.

I've been looking for simple GUI library for Golang, and I think this library matches my requirement. However, I noticed that you use LGPL-2 as the license for this library.

As far as I know, LGPL license insists that end user must be able to recombine or relink the application with a modified or different version of the LGPL library. However, Golang as today only support static linking the library.

That means, if I use this library for my Golang project, I can't create a closed source application, because according to LGPL the end user must be able to swap the LGPL library with other version that he wants. And since Golang still not supporting dynamic linking, my only choice is to give the end user my source code, so he can compile it with his own library.

You can see more details about implication of using LGPL license in Golang project here.

So, is it possible for you to change the LGPL license to more permissive license ? Maybe for example you can use MIT License, Apache 2.0 or BSD 3.0. I personally recommended Apache 2.0 which allows the programmer to use your library however he/she want, as long as he/she gives proper attribution to you as the creator of this library.

Thank you.

SetOnMouseWheelDown与SetOnMouseWheelUp怎么获取滚动的次数

f.SetOnMouseWheelDown(func(sender vcl.IObject, shift types.TShiftState, mousePos types.TPoint, handled *bool) {
fmt.Println("mouse wheel down:", mousePos.X, mousePos.Y, *handled, shift)
})
f.SetOnMouseWheelUp(func(sender vcl.IObject, shift types.TShiftState, mousePos types.TPoint, handled *bool) {
fmt.Println("mouse wheel up:", mousePos.X, mousePos.Y, *handled, shift)
})
mouse wheel down: 63 49 false 0
mouse wheel up: 49 52 false 0
好像没有无法获取向上或向下滚动的次数

Feature Request: TSelectDirectoryDialog

Thanks for the great job.
res2go displays a message: Warning: "DlgSelectFolder:TSelectDirectoryDialog" is not supported and it may fail to create.
Possible to add TSelectDirectoryDialogto this binding?

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 !!

应用程序代码中引入 “C” 会导致链接不过

windows系统下,使用框架后,在业务代码中原来有引入C库的代码,会变成链接不通过了。错误提示如下。需要配置什么吗?
c:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\xx\AppData\Local\Temp\go-link-667343987\000000.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status

how to access style files for sample "style"

Hi,
first, thanks for your work. just discovered it and looks great !

now, in the readme of "style" sample there's a link to download style files, but it's on a Chinese website witch - I think - ask me to register.
can't you put the files on the same place as the vcl & lcl libraries so we can directly have access ?
thanks

窗体是否可以设置边框不能随意拉伸

   窗体在设计好内容后,还是可以随便拖拉边框,显示一些框外区域。测试过SetScaled, SetEnabled, SetAutoSize, SetDockSite等,都不管用。
   不确定是我使用方法不正确还是暂时没有支持,劳烦指点下。感谢感谢!!!

在 go() 中执行 form.ShowModal 导致form或者parent卡死

环境是win10 64位,测试代码如下:

package main

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

var fm_main *vcl.TForm
var dlg *vcl.TForm

func main() {
	vcl.Application.Initialize()
	fm_main = vcl.Application.CreateForm()
	fm_main.EnabledMaximize(false)
	fm_main.ScreenCenter()

	btn_open_dlg := vcl.NewButton(fm_main)
	btn_open_dlg.SetParent(fm_main)
	btn_open_dlg.SetCaption("open dlg")
	btn_open_dlg.SetOnClick(func(sender vcl.IObject) {
		go func() { //  放到独立线程里,关掉dlg就会卡死, 去掉 go func() 直接执行就ok
			dlg.Show() // 或者改成 dlg.ShowModal()
		}()
	})

	dlg = vcl.NewForm(fm_main)
	btn_dlg := vcl.NewButton(dlg)
	btn_dlg.SetParent(dlg)
	btn_dlg.SetCaption("Close Dialog")
	btn_dlg.SetOnClick(func(sender vcl.IObject) {
		dlg.Close()
	})
	vcl.Application.Run()
}

dlg.Show() 会让dlg卡死, dlg.ShowModal()关掉dlg后会让主窗体卡死。。

关闭按钮加提示窗口无法生效?

mainForm.SetOnClose(func(sender vcl.IObject, action *types.TCloseAction) { fmt.Println("close main form") CloseApp.Show() mainForm.Hide() })
mainForm.SetOnDestroy(func(sender vcl.IObject) { fmt.Println("destory main form") })
关闭窗口的时候,我确定走了上述两个方法,但是CloseApp窗口还是没有显示出来就服务器停止了
并且此closeApp窗口,我在其他按钮上面测试,是可以正常显示的。
劳烦大佬了!!!

Method 2里的按钮样式不是系统样式?

系统:win10 1607
golang: 1.11.4
govcl:最新。
按照readme里的实例:
Method 1里的按钮样式没问题,和系统一致。而Method 2里的按钮样式不是系统样式?

2018-12-19_231516

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?

支持vcl下的TCardPanel

类似于Qt下的QStackedWidget,Flex中的ViewStack。TPageControl可以部分模拟,但效果不太好。虽然只支持vcl,但某些特殊情况下还是比较有用,希望能够支持,多谢!

按钮是否可以修改背景颜色的,自定义文字

目前几种按钮要么只能支持背景,无法设置文字;要么文字与颜色分开的(左右上下)。需要文字是输入的,背景是通过图片或颜色进行设定的按钮,是否可以支持下,非常感谢!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.