summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskanehira <sho19921005@gmail.com>2019-10-24 05:25:53 +0900
committerskanehira <sho19921005@gmail.com>2019-10-24 05:25:53 +0900
commitbd40964ceccb4741bf379dae6758e85f199d7ce7 (patch)
tree38d748c9c21eecd117ca857128885d59f39d3be6
parent62f1124fe9b152934c621caa75ae963759cc3c9e (diff)
improve display process info
-rw-r--r--gui/processInfo.go18
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) {