diff options
author | skanehira <sho19921005@gmail.com> | 2019-10-24 05:25:53 +0900 |
---|---|---|
committer | skanehira <sho19921005@gmail.com> | 2019-10-24 05:25:53 +0900 |
commit | bd40964ceccb4741bf379dae6758e85f199d7ce7 (patch) | |
tree | 38d748c9c21eecd117ca857128885d59f39d3be6 | |
parent | 62f1124fe9b152934c621caa75ae963759cc3c9e (diff) |
improve display process info
-rw-r--r-- | gui/processInfo.go | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/gui/processInfo.go b/gui/processInfo.go index 4e854f7..241e403 100644 --- a/gui/processInfo.go +++ b/gui/processInfo.go @@ -20,26 +20,10 @@ func NewProcessInfoView() *ProcessInfoView { } func (p *ProcessInfoView) UpdateInfo(g *Gui) { - text := "" proc := g.ProcessManager.Selected() if proc != nil { - info, err := g.ProcessManager.Info(proc.Pid) - if err != nil { - text = err.Error() - } else { - rows := strings.Split(info, "\n") - if len(rows) == 1 { - text = rows[0] - } else { - header := fmt.Sprintf("[yellow]%s[white]\n", rows[0]) - text = header + rows[1] - } - } + p.UpdateInfoWithPid(g, proc.Pid) } - - g.App.QueueUpdateDraw(func() { - p.SetText(text) - }) } func (p *ProcessInfoView) UpdateInfoWithPid(g *Gui, pid int) { |