{"id":3173,"date":"2019-12-10T18:14:07","date_gmt":"2019-12-10T09:14:07","guid":{"rendered":"http:\/\/oohito.com\/nqthm\/?p=3173"},"modified":"2022-08-21T18:14:40","modified_gmt":"2022-08-21T09:14:40","slug":"spec2%e5%85%a5%e9%96%80%ef%bc%88%e3%81%9d%e3%81%ae%ef%bc%95%ef%bc%89","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/3173","title":{"rendered":"Spec2\u5165\u9580\uff08\u305d\u306e\uff15\uff09"},"content":{"rendered":"\n<p>\u3053\u308c\u306f<a href=\"https:\/\/qiita.com\/advent-calendar\/2019\/smalltalk\">Smalltalk Advent Calendar 2019<\/a>\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n\n\n\n<p>Spec2\u306f\u3001Pharo Smalltalk \u3067\u63a1\u7528\u3055\u308c\u3066\u3044\u308bUI\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308bSpec \u306e\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002Pharo 7.0 \u3067\u306f Spec \u304c\u4f7f\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001Pharo 8 \u3067\u306f\uff08\u307b\u307c\uff1f\uff09\u5168\u3066\u306eUI\u304c Spec2 \u3067\u66f8\u304d\u76f4\u3055\u308c\u308b\u3088\u3046\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f Spec2 \u3092\u4f7f\u3063\u305f UI \u306e\u5b9f\u88c5\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Squeak\/Pharo Smalltalk \u3067\u306f\u3001UI\u306e\u5b9f\u73fe\u306e\u305f\u3081\u306b\u9577\u3089\u304f Morphic \u3092\u7528\u3044\u3066\u304d\u307e\u3057\u305f\u3002Morphic \u306f\u30b7\u30f3\u30d7\u30eb\u3067\u5f37\u529b\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u304c\u3001\u8907\u6570\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3044\u304f\u3068\u30a2\u30ca\u30fc\u30ad\u30fc\u306a\u5b9f\u88c5\u3092\u3057\u304c\u3061\u3067\u3001\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3084\u518d\u5229\u7528\u306e\u969b\u306b\u6ce3\u304d\u305f\u304f\u306a\u308b\u3088\u3046\u306a\u72b6\u6cc1\u306b\u9665\u308a\u304c\u3061\u3067\u3059\u3002Spec\/Spec2 \u306fUI\u306e\u69cb\u7bc9\u306b\u79e9\u5e8f\u3092\u3082\u305f\u3089\u3057\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u518d\u5229\u7528\u304c\u3057\u3084\u3059\u304f\u8a2d\u8a08\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><a href=\"http:\/\/oohito.com\/nqthm\/archives\/3170\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3067\u306f\u3001Scratch 1.4\u98a8\u306e\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u30c0\u30a4\u30a2\u30ed\u30b0\u306b\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u79fb\u52d5\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u524d\u56de\u306f\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u305f\u3089\u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\u6a5f\u80fd\u3092\u4ed8\u3051\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3060\u3068\u6df1\u304f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5165\u3063\u3066\u3044\u304f\u3060\u3051\u306a\u306e\u3067\u3001\u4eca\u56de\u306f\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u968e\u5c64\u304c\u308f\u304b\u308b\u3088\u3046\u306a\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u3082\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u3068\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3059\u308b<\/h2>\n\n\n\n<p>\u65b0\u3057\u304f\u30dc\u30bf\u30f3\u3068\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u3092\u683c\u7d0d\u3059\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u3092\u52a0\u3048\u3066\u30af\u30e9\u30b9\u3092\u518d\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SpPresenter subclass: #SpecFileListSample\n     instanceVariableNames: 'directory listEntries buttonParent listCurrent'\n     classVariableNames: ''\n     package: 'SpecSample'<\/pre>\n\n\n\n<p>\u8ffd\u52a0\u3057\u305f\u306e\u306f buttonParent \u3068 listCurrent \u3067\u3001\u305d\u308c\u305e\u308c\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u306e\u79fb\u52d5\u30dc\u30bf\u30f3\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u968e\u5c64\u3092\u8868\u3059\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u3092\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3044\u3064\u3082\u306e\u3088\u3046\u306b initializePresenters \u3067\u3001\u305d\u308c\u305e\u308c\u306e\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">initializePresenters\n     listEntries := self newList\n         beSingleSelection;\n         activateOnDoubleClick;\n         items: self getEntries.\n<strong>     buttonParent := self newButton\n         icon: (Smalltalk ui icons iconNamed: #up).<\/strong>\n<strong>     listCurrent := self newDropList.\n<\/strong>     (\u4ee5\u4e0b\u7565)<\/pre>\n\n\n\n<p>\u4ee5\u524d\u306b\u7d39\u4ecb\u3057\u305f\u3068\u304a\u308a\u3001\u30dc\u30bf\u30f3\u306f self newButton \u3067\u751f\u6210\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u306f self newDropList \u3067\u751f\u6210\u3057\u307e\u3059\u3002\u30dc\u30bf\u30f3\u306b\u306f\u4e0a\u77e2\u5370\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u4ed8\u3051\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30dc\u30bf\u30f3\u306e\u6a5f\u80fd\u306e\u8a2d\u5b9a\u306f\u3001 connectPresenters \u30e1\u30bd\u30c3\u30c9\u3067\u884c\u3044\u307e\u3059\u3002\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\u3089 changeParentDirectory \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u3063\u3066\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\uff08\u592a\u5b57\u90e8\u5206\u3092\u8ffd\u52a0\u3057\u307e\u3059\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30dc\u30bf\u30f3\u306e\u6a5f\u80fd\u3092\u8a2d\u5b9a\u3059\u308b<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">connectPresenters\n     listEntries\n         display: [ :m | self showEntry: m ];\n         whenActivatedDo: [ :selection | self entriesChanged: selection ].\n     <strong>buttonParent action: [ self changeParentDirectory ].<\/strong><\/pre>\n\n\n\n<p>changeParentDirectory \u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002\u5358\u306b\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u306a\u3051\u308c\u3070\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u8a2d\u5b9a\u3057\u306a\u304a\u3059\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">changeParentDirectory\n     directory isRoot ifTrue: [ ^ self ].\n     self directory: directory parent<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u4fee\u6b63\u3059\u308b<\/h3>\n\n\n\n<p>\u30ec\u30a4\u30a2\u30a6\u30c8\u3092 Scratch 1.4 \u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-06-20-33-58-1-700x383.png\" alt=\"\" class=\"wp-image-3164\"\/><\/figure>\n\n\n\n<p>\u4e0a\u306e\u56f3\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u306e\u4e0a\u5074\u306b\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u3068\u30dc\u30bf\u30f3\u304c\u4e00\u5217\u306b\u306a\u3089\u3093\u3067\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e defaultSpec \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">defaultSpec\n     ^ SpBoxLayout newVertical\n         add:\n             (SpBoxLayout newHorizontal\n                 add: #listCurrent;\n                 add: #buttonParent;\n                 yourself);\n         add: #listEntries;\n         yourself<\/pre>\n\n\n\n<p>SpBoxLayout newVertical \u3067\u751f\u6210\u3055\u308c\u305f\u7e26\u4e26\u3073\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3001SpBoxLayout newHorizontal \u3067\u751f\u6210\u3055\u308c\u305f\u6a2a\u4e26\u3073\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u3001\u305d\u3053\u3067\u30c9\u30ed\u30c3\u30d7\u30ea\u30b9\u30c8\u3068\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-10-18-02-41-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u3053\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u8a2d\u5b9a\u3067\u8868\u793a\u3055\u305b\u308b\u3068\u3001\u4e0a\u306e\u3088\u3046\u306b\u9ad8\u3055\u3084\u5e45\u304c\u5747\u7b49\u306a\u72b6\u614b\u306b\u306a\u3063\u3066\u4e0d\u683c\u597d\u3067\u3059\u3002\u305d\u3053\u3067\u3001\u5b50\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u5e45\u3084\u9ad8\u3055\u3092\u5236\u9650\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">defaultSpec\n     ^ SpBoxLayout newVertical\n         add:\n             (SpBoxLayout newHorizontal\n                 add: #listCurrent;\n                 add: #buttonParent<strong> withConstraints: [ :c | c expand: false ]<\/strong>;\n                 yourself)\n             <strong>withConstraints: [ :c | c expand: false ]<\/strong>;\n         add: #listEntries;\n         yourself<\/pre>\n\n\n\n<p>withConstraints: \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30ec\u30a4\u30a2\u30a6\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u9001\u308b\u3068\u3001\u5e45\u3084\u9ad8\u3055\u306a\u3069\u3092\u7d30\u304b\u304f\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002width: \u3084 height: \u3067\u76f4\u63a5\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f expand: false \u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u3053\u3068\u3067\u5e45\u3084\u9ad8\u3055\u3092\u62e1\u5f35\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-10-18-08-27-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u9593\u306b\u30b9\u30da\u30fc\u30b9\u3092\u5165\u308c\u308b<\/h3>\n\n\n\n<p>\u4eca\u5ea6\u306f\u4e0a\u9650\u306e\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u304c\u8a70\u307e\u308a\u3059\u304e\u306a\u306e\u3067\u3001\u9593\u306b\u30b9\u30da\u30fc\u30b9\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">defaultSpec\n     ^ SpBoxLayout newVertical\n<strong>         spacing: 4;<\/strong>\n         add:\n             (SpBoxLayout newHorizontal<\/pre>\n\n\n\n<p>spacing: \u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u9593\u306e\u30b9\u30da\u30fc\u30b9\u3092\u8abf\u6574\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3067\u4e0b\u56f3\u306e\u3088\u3046\u306b\u3059\u3063\u304d\u308a\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/oohito.com\/nqthm\/wp-content\/uploads\/2019\/12\/Screenshot-from-2019-12-10-18-10-34-1.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u53f3\u5074\u306e\u30dc\u30bf\u30f3\u3092\u62bc\u305b\u3070\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\u3053\u3068\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\u30dc\u30bf\u30f3\u306e\u8ffd\u52a0\u306f\u4ee5\u4e0a\u3067\u3059\u3002\u30ea\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u6a5f\u80fd\u306f\u5b9f\u73fe\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u306e\u3067\u3001\u6b21\u56de\u306b\u56de\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u308c\u306fSmalltalk Advent Calendar 2019\u306e\u8a18\u4e8b\u3067\u3059\u3002 Spec2\u306f\u3001Pharo Smalltalk \u3067\u63a1\u7528\u3055\u308c\u3066\u3044\u308bUI\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308bSpec \u306e\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3059\u3002Pharo 7.0 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-3173","post","type-post","status-publish","format-standard","hentry","category-pharo"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=3173"}],"version-history":[{"count":1,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3173\/revisions"}],"predecessor-version":[{"id":3499,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3173\/revisions\/3499"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=3173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=3173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=3173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}