From: qydysky Date: Sat, 12 Jun 2021 10:16:08 +0000 (+0800) Subject: gtk fix X-Git-Tag: v0.5.10~41^2~105 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=f2c5bf3483be6f52e1073bd5a301c83812ad80c5;p=bili_danmu%2F.git gtk fix --- diff --git a/Reply/gtk.go b/Reply/gtk.go index 1c404d6..60415a8 100644 --- a/Reply/gtk.go +++ b/Reply/gtk.go @@ -547,13 +547,13 @@ func show(s,img_src string,to_grid ...int){ sty.AddClass("highlight") } } - item.handle,_ = item.text.Connect("size-allocate", func(_,_ interface{},item *danmu_item){ - if item == nil || (*item).text == nil {return} - b,e := (*item).text.GetBuffer() + item.handle = item.text.Connect("size-allocate", func(text *gtk.TextView){ + if text == nil {return} + b,e := text.GetBuffer() if e != nil {log.Println(e);return} b.SetText(s) in_smooth_roll = true - },&item) + }) } item.img,_ = gtk.ImageNew(); diff --git a/demo/go.mod b/demo/go.mod index c5d2009..66cf4e0 100644 --- a/demo/go.mod +++ b/demo/go.mod @@ -19,8 +19,8 @@ require ( github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect github.com/tklauser/go-sysconf v0.3.6 // indirect - golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect - golang.org/x/sys v0.0.0-20210608053332-aa57babbf139 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/sys v0.0.0-20210611083646-a4fc73990273 // indirect ) replace ( diff --git a/demo/go.sum b/demo/go.sum index 4f5ac51..1315ff5 100644 --- a/demo/go.sum +++ b/demo/go.sum @@ -422,6 +422,8 @@ golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -489,6 +491,8 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7q golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210608053332-aa57babbf139 h1:C+AwYEtBp/VQwoLntUmQ/yx3MS9vmZaKNdw5eOpoQe8= golang.org/x/sys v0.0.0-20210608053332-aa57babbf139/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210611083646-a4fc73990273 h1:faDu4veV+8pcThn4fewv6TVlNCezafGoC1gM/mxQLbQ= +golang.org/x/sys v0.0.0-20210611083646-a4fc73990273/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=