{"id":28360,"date":"2015-03-13T00:39:32","date_gmt":"2015-03-12T15:39:32","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=28360"},"modified":"2015-03-13T00:39:32","modified_gmt":"2015-03-12T15:39:32","slug":"termui","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/termui\/","title":{"rendered":"termui - Go\u3067\u4f5c\u3089\u308c\u305f\u30bf\u30fc\u30df\u30ca\u30eb\u30d9\u30fc\u30b9\u306e\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2015\/03\/I-2015-03-13-0.22.26.png\" alt=\"2015 03 13 0 22 26\" title=\" 2015-03-13 0.22.26.png\" border=\"0\" width=\"546\" height=\"366\" \/><\/p>\n<p>\u300c<a href=\"https:\/\/github.com\/gizak\/termui\">termui<\/a>\u300d\u306f\u3001Go\u3067\u4f5c\u3089\u308c\u305f\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u52d5\u4f5c\u3059\u308b\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u30bd\u30d5\u30c8\u3067\u3059\u3002\u30b5\u30a4\u30c8\u306e\u8aac\u660e\u306b\u3088\u308b\u3068\u3001<a href=\"https:\/\/github.com\/yaronn\/blessed-contrib\">blessed-contrib<\/a>\u3068\u3044\u3046JavaScript\u88fd\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u30bd\u30d5\u30c8\u306b\u89e6\u767a\u3055\u308c\u305f\u305d\u3046\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u306f\u7d14\u7c8b\u306bGo\u3060\u3051\u3067\u4f5c\u3089\u308c\u3066\u3044\u308b\u3068\u3053\u308d\u304c\u7279\u5fb4\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Go\u8a00\u8a9e\u306e\u304a\u304b\u3052\u3067\u3001\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u52d5\u4f5c\u3057\u3001\u7c21\u5358\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u53ef\u80fd\u3067\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3082\u7c21\u5358\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3092\u63a2\u3057\u3066\u3044\u308b\u65b9\u306f\u8a66\u3057\u3066\u307f\u308b\u3068\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u5b9f\u884c\u65b9\u6cd5<\/h2>\n<p>Go\u306e\u5b9f\u884c\u74b0\u5883\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u3068\u3057\u3066\u3001\u307e\u305a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067termui\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>\ngo get github.com\/gizak\/termui\n<\/pre>\n<p>\u809d\u5fc3\u306e\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306e\u5b9a\u7fa9\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bGo\u8a00\u8a9e\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"go\">import ui \"github.com\/gizak\/termui\" \/\/ <- ui shortcut, optional\n\n    func main() {\n        err := ui.Init()\n        if err != nil {\n            panic(err)\n        }\n        defer ui.Close()\n\n        p := ui.NewPar(\":PRESS q TO QUIT DEMO\")\n        p.Height = 3\n        p.Width = 50\n        p.TextFgColor = ui.ColorWhite\n        p.Border.Label = \"Text Box\"\n        p.Border.FgColor = ui.ColorCyan\n\n        g := ui.NewGauge()\n        g.Percent = 50\n        g.Width = 50\n        g.Height = 3\n        g.Y = 11\n        g.Border.Label = \"Gauge\"\n        g.BarColor = ui.ColorRed\n        g.Border.FgColor = ui.ColorWhite\n        g.Border.LabelFgColor = ui.ColorCyan\n\n        ui.Render(p, g)\n\n        \/\/ event handler...\n    }\n<\/code><\/pre>\n<p>\u3068\u308a\u3042\u3048\u305a\u52d5\u304b\u3057\u305f\u3044\u5834\u5408\u3001termui\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u542b\u307e\u308c\u308bexample\u3092\u5b9f\u884c\u3059\u308b\u306e\u304c\u624b\u3063\u53d6\u308a\u65e9\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre>\n$ git clone gizak\/termui\n$ cd termui\/example\n$ go run dashboard.go\n<\/pre>\n<p>\u30c6\u30fc\u30de\u6a5f\u80fd\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c0\u30fc\u30af\u30e2\u30fc\u30c9\u306e\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2015\/03\/I-2015-03-13-0.32.03.png\" alt=\"2015 03 13 0 32 03\" title=\" 2015-03-13 0.32.03.png\" border=\"0\" width=\"546\" height=\"366\" \/><\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u306e\u306f\u67a0\u7d44\u307f\u3060\u3051\u306a\u306e\u3067\u3001\u305d\u3053\u306b\u4f55\u3092\u8868\u793a\u3059\u308b\u304b\u306f\u81ea\u5206\u3067\u30ab\u30b9\u30bf\u30de\u30a4\u30ba(\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0)\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u7c21\u5358\u306a\u3082\u306e\u304b\u3089\u9664\u3005\u306b\u6a5f\u80fd\u3092\u5897\u3084\u3057\u3066\u3044\u304f\u3068\u3001\u5b9f\u7528\u6027\u3068\u3068\u3082\u306b\u81ea\u5206\u306eGo\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6280\u8853\u3082\u5411\u4e0a\u3057\u3066\u3044\u304f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3092\u7d14\u7c8b\u306b\u4f7f\u3044\u305f\u3044\u65b9\u306b\u3082\u3001\u4eca\u5e74\u3053\u305d\u306fGo\u8a00\u8a9e\u3092\u52c9\u5f37\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u308b\u958b\u767a\u8005\u306e\u65b9\u306b\u3082\u304a\u3059\u3059\u3081\u306e\u30bd\u30d5\u30c8\u3068\u3044\u3048\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300ctermui\u300d\u306f\u3001Go\u3067\u4f5c\u3089\u308c\u305f\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u52d5\u4f5c\u3059\u308b\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u30bd\u30d5\u30c8\u3067\u3059\u3002\u30b5\u30a4\u30c8\u306e\u8aac\u660e\u306b\u3088\u308b\u3068\u3001blessed-contrib\u3068\u3044\u3046JavaScript\u88fd\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u30bd\u30d5\u30c8\u306b\u89e6\u767a\u3055\u308c\u305f\u305d\u3046\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u306f\u7d14\u7c8b\u306bG [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":28358,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[1607,711,1211],"class_list":["post-28360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-dashboard","tag-go","tag-terminal"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/28360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=28360"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/28360\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/28358"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=28360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=28360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=28360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}