From 1f33979af9d295ab7957dca55db9be5ba19c6324 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 13 Feb 2025 21:04:37 -0600 Subject: add Disable() and Enable() --- init.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'init.go') diff --git a/init.go b/init.go index 3a63c0a..4546b72 100644 --- a/init.go +++ b/init.go @@ -208,6 +208,17 @@ func waitOK() { } } +// this hack is to wait for the application to send something +// before trying to do anything. todo: rethink this someday +func waitFirstWindow() { + for { + if me.firstWindowOk { + return + } + time.Sleep(10 * time.Millisecond) + } +} + // empty function. this triggers gocui to refresh the screen func testRefresh(*gocui.Gui) error { // log.Info("in testRefresh") @@ -279,10 +290,15 @@ func newWindowTrigger() { waitOK() time.Sleep(200 * time.Millisecond) redoWindows(3, 3) + me.firstWindowOk = true if !me.stdout.init { me.stdout.init = true relocateStdoutOffscreen() } + if me.textbox.tk == nil { + initTextbox() + me.textbox.tk.prepTextbox() + } tk.makeWindowActive() } } -- cgit v1.2.3