Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
twgh committed Dec 26, 2022
1 parent 3d8e1e5 commit 853f940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">XCGUI</h1>
<p align="center">
<a href="https://github.com/twgh/xcgui/releases"><img src="https://img.shields.io/badge/release-1.3.371-blue" alt="release"></a>
<a href="https://github.com/twgh/xcgui/releases"><img src="https://img.shields.io/badge/release-1.3.372-blue" alt="release"></a>
<a href="http://www.xcgui.com"><img src="https://img.shields.io/badge/XCGUI-3.3.7-blue" alt="XCGUI"></a>
<a href="https://golang.org"> <img src="https://img.shields.io/badge/golang-1.16-blue" alt="golang"></a>
<a href="https://pkg.go.dev/github.com/twgh/xcgui"><img src="https://img.shields.io/badge/go.dev-reference-brightgreen" alt="GoDoc"></a>
Expand Down Expand Up @@ -203,7 +203,7 @@ xc包里包含xcgui.dll里所有的API,有一千多个函数,可以直接使

炫彩的全部事件都已经定义好了,都是以Event开头的, 以1结尾的事件是会传进去元素的句柄。

在循环中注册事件时,回调函数尽量不要使用匿名函数,使用匿名函数意味着您每次都在创建1个新的回调,最终您将会遇到因创建过多回调导致程序崩溃的报错(大概在2000个回调时会遇到),事件回调函数不使用匿名函数即可避免此问题,一般程序应该不会用到2000个事件,只要注意在循环中注册事件时不使用匿名函数就行。
在循环中注册事件时,回调函数尽量不要使用匿名函数,使用匿名函数意味着您每次都在创建1个新的回调,最终您将会遇到因创建过多回调导致程序崩溃的报错(大概在2000个回调时会遇到),事件回调函数不使用匿名函数即可避免此问题,一般程序应该不会用到2000个事件,只要注意在循环中注册事件时不使用匿名函数就行。这个是golang的限制,不是xcgui添加的限制。

[![xc-event.png](https://z3.ax1x.com/2021/11/23/opdyh6.png)](https://z3.ax1x.com/2021/11/23/opdyh6.png)

Expand Down

0 comments on commit 853f940

Please sign in to comment.