From a87a05c8cd8de833dd891a80e86016da8f1fd0a4 Mon Sep 17 00:00:00 2001 From: qydysky Date: Tue, 29 Dec 2020 22:48:00 +0800 Subject: [PATCH] =?utf8?q?=E5=BD=93gtk=E5=85=A8=E9=83=A8=E5=85=B3=E9=97=AD?= =?utf8?q?=E6=97=B6=E5=81=9C=E6=AD=A2=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/gtk.go | 5 +++-- bili_danmu.go | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Reply/gtk.go b/Reply/gtk.go index 1287efc..837e6ad 100644 --- a/Reply/gtk.go +++ b/Reply/gtk.go @@ -353,7 +353,7 @@ func Gtk_danmu() { grid0.InsertRow(loc); grid0.Attach(tmp_list.img, 0, loc, 1, 1) grid0.Attach(tmp_list.text, 1, loc, 1, 1) - win.ShowAll() + if Gtk_on {win.ShowAll()} return } /* @@ -397,7 +397,7 @@ func Gtk_danmu() { // grid0.Attach(tmp_list1.text, 1, loc, 1, 1) } - win.ShowAll() + if Gtk_on {win.ShowAll()} } //先展示弹幕信息窗 @@ -570,6 +570,7 @@ func Gtk_danmu() { application.Connect("shutdown", func() { log.Println("application shutdown") Gtk_on = false + c.Danmu_Main_mq.Push_tag(`gtk_close`,nil) }) application.Run(nil) diff --git a/bili_danmu.go b/bili_danmu.go index 987e385..a110772 100644 --- a/bili_danmu.go +++ b/bili_danmu.go @@ -79,6 +79,10 @@ func Demo(roomid ...int) { } return false }, + `gtk_close`:func(data interface{})(bool){//gtk关闭信号 + interrupt <- os.Interrupt + return false + }, }) <-change_room_chan -- 2.39.2