{"id":3961,"date":"2022-08-25T22:29:37","date_gmt":"2022-08-25T13:29:37","guid":{"rendered":"https:\/\/www.python.ambitious-engineer.com\/?p=3961"},"modified":"2022-08-25T22:29:37","modified_gmt":"2022-08-25T13:29:37","slug":"tkinter-place","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/3961","title":{"rendered":"Tkinter place"},"content":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001place\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u914d\u7f6e\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u5c11\u3057\u8907\u96d1\u3067\u9577\u3044\u305f\u3081\u4e00\u65e6\u3055\u3089\u3063\u3068\u6d41\u3057\u8aad\u307f\u3001\u5b9f\u969b\u306bGUI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u969b\u306b\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8aad\u3080\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2>place<\/h2>\n<p>place\u30e1\u30bd\u30c3\u30c9\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u4e0a\u306e\u53f3\u4e0a\u3092\u539f\u70b9\u3068\u3057\u305fx, y\u5ea7\u6a19\u3092\u6307\u5b9a\u3057\u3066\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u5ea7\u6a19(300, 200)\u306b\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u914d\u7f6e\u3057\u305f\u5834\u5408\u306e\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<a href=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image.png\"><img loading=\"lazy\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image-1024x640.png\" alt=\"\" width=\"654\" height=\"409\" class=\"alignnone size-large wp-image-3966\" srcset=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image-1024x640.png 1024w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image-300x188.png 300w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image-768x480.png 768w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image-718x449.png 718w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_image.png 1080w\" sizes=\"(max-width: 654px) 100vw, 654px\" \/><\/a>\n<p>\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u4e0a\u306e\u5de6\u4e0a\u304c\u5ea7\u6a19\u6307\u5b9a\u70b9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u70b9\u3092\u30a2\u30f3\u30ab\u30fc\u3068\u547c\u3073\u307e\u3059\u3002\u30a2\u30f3\u30ab\u30fc\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5de6\u4e0a\u3067\u3059\u304c\u30018\u65b9\u3068\u4e2d\u592e\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u5ea7\u6a19\u306f\u7d76\u5bfe\u5ea7\u6a19\u4ee5\u5916\u306b\u76f8\u5bfe\u5ea7\u6a19\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u66f8\u5f0f\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8.place(**\u30aa\u30d7\u30b7\u30e7\u30f3)\r\n<\/pre>\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u6307\u5b9a\u3067\u304d\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>x\uff1ax\u8ef8\u7d76\u5bfe\u5ea7\u6a19<\/li>\n<li>y\uff1ay\u8ef8\u7d76\u5bfe\u5ea7\u6a19<\/li>\n<li>relx\uff1ax\u8ef8\u76f8\u5bfe\u5ea7\u6a19<\/li>\n<li>rely\uff1ay\u8ef8\u76f8\u5bfe\u5ea7\u6a19<\/li>\n<li>anchor\uff1a\u30a2\u30f3\u30ab\u30fc\u4f4d\u7f6e<\/li>\n<li>width\uff1a\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u5e45\u306e\u7d76\u5bfe\u8ddd\u96e2<\/li>\n<li>height\uff1a\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u9ad8\u306e\u7d76\u5bfe\u8ddd\u96e2<\/li>\n<li>relwidth\uff1a\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u5e45\u306e\u76f8\u5bfe\u8ddd\u96e2<\/li>\n<li>relheight\uff1a\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u9ad8\u306e\u76f8\u5bfe\u8ddd\u96e2<\/li>\n<\/ul>\n<p>\u4f8b\u3048\u3070\u3001\u30e9\u30d9\u30eb\u3092\u5ea7\u6a19(300, 200)\u306b\u914d\u7f6e\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport tkinter as tk\r\n\r\nroot = tk.Tk()\r\nroot.title('place sample')\r\nroot.geometry(&quot;360x240&quot;)\r\n\r\nlabel = tk.Label(\r\n    root,\r\n    text=&quot;sample&quot;,\r\n    bg='red',\r\n    fg='white'\r\n)\r\n\r\nlabel.place(x=300, y=200)\r\nroot.mainloop()\r\n\r\n<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30e9\u30d9\u30eb\u304c\u914d\u7f6e\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_sample.png\"><img loading=\"lazy\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_sample.png\" alt=\"\" width=\"632\" height=\"475\" class=\"alignnone size-full wp-image-3969\" srcset=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_sample.png 632w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_sample-300x225.png 300w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a><\/p>\n<h2>\u30a2\u30f3\u30ab\u30fc<\/h2>\n<p>\u5148\u7a0b\u89e3\u8aac\u3057\u305f\u3068\u304a\u308a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5de6\u4e0a\u306e\u5ea7\u6a19\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u304c\u3001anchor\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u30a2\u30f3\u30ab\u30fc\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u901a\u308atk\u30e2\u30b8\u30e5\u30fc\u30eb\u306eN\u3001E\u3001W\u3001S\u306e4\u65b9\u4f4d\u3092\u7d44\u307f\u5408\u308f\u305b\u305f8\u65b9\u3068Center\u306e\u8a089\u7a2e\u985e\u6307\u5b9a\u304c\u6307\u5b9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<table id=\"anchortbl\" border=\"1\">\n<tr>\n<td  style=\"text-align: center;\">NW<\/td>\n<td  style=\"text-align: center;\">N<\/td>\n<td  style=\"text-align: center;\">NE<\/td>\n<\/tr>\n<tr>\n<td  style=\"text-align: center;\">W<\/td>\n<td  style=\"text-align: center;\" bgcolor=\"#FFE0E0\">CENTER<\/td>\n<td  style=\"text-align: center;\">E<\/td>\n<\/tr>\n<tr>\n<td  style=\"text-align: center;\">SW<\/td>\n<td  style=\"text-align: center;\">S<\/td>\n<td  style=\"text-align: center;\">SE<\/td>\n<\/tr>\n<\/table>\n<p>\u4f8b\u3048\u3070\u3001\u30a2\u30f3\u30ab\u30fc\u3092\u4e2d\u592e\u306b\u3057\u3001\u30e9\u30d9\u30eb\u3092\u914d\u7f6e\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center.png\"><img loading=\"lazy\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center-1024x617.png\" alt=\"\" width=\"654\" height=\"394\" class=\"alignnone size-large wp-image-3982\" srcset=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center-1024x617.png 1024w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center-300x181.png 300w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center-768x463.png 768w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center-718x432.png 718w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center.png 1187w\" sizes=\"(max-width: 654px) 100vw, 654px\" \/><\/a><\/p>\n<p>\u5148\u7a0b\u306e\u30b3\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001CENTER\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nlabel.place(x=300, y=200, anchor=tk.CENTER)\r\n<\/pre>\n<h2>\u76f8\u5bfe\u5ea7\u6a19\u6307\u5b9a<\/h2>\n<p>\u5ea7\u6a19\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u4e0a\u306e\u76f8\u5bfe\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u76f8\u5bfe\u4f4d\u7f6e\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u30b5\u30a4\u30ba\u30921\u3068\u3057\u30010\uff5e1\u306e\u7bc4\u56f2\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u753b\u9762\u4e2d\u592e\u306b\u914d\u7f6e\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport tkinter as tk\r\n\r\nroot = tk.Tk()\r\nroot.title('place sample')\r\nroot.geometry(&quot;360x240&quot;)\r\n\r\nlabel = tk.Label(\r\n    root,\r\n    text=&quot;sample&quot;,\r\n    bg='red',\r\n    fg='white'\r\n)\r\n\r\nlabel.place(relx=0.5, rely=0.5, anchor=tk.CENTER)\r\nroot.mainloop()\r\n\r\n<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<a href=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel.png\"><img loading=\"lazy\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel.png\" alt=\"\" width=\"632\" height=\"475\" class=\"alignnone size-full wp-image-3984\" srcset=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel.png 632w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel-300x225.png 300w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a>\n<p>\u5148\u7a0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u30b5\u30a4\u30ba\u3092\u5909\u3048\u308b\u3068\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u4f4d\u7f6e\u304c\u4e2d\u592e\u3092\u4fdd\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u76f8\u5bfe\u5ea7\u6a19\u3092\u6307\u5b9a\u3059\u308b\u3068\u30a6\u30a3\u30f3\u30c9\u30a6\u30b5\u30a4\u30ba\u3092\u5909\u3048\u3066\u3082\u4f4d\u7f6e\u95a2\u4fc2\u3092\u4fdd\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u5e45\u3001\u9ad8\u3055\u306e\u6307\u5b9a<\/h2>\n<h3>width\u3068height<\/h3>\n<p>width\u3068height\u3067\u7d76\u5bfe\u8ddd\u96e2\u306b\u3088\u308b\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u5e45\u3001\u9ad8\u3055\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u5148\u7a0b\u306e\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001100x50\u306e\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u914d\u7f6e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nlabel.place(relx=0.5, rely=0.5, anchor=tk.CENTER, width=100, height=50)\r\n<\/pre>\n<a href=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_wh.png\"><img loading=\"lazy\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_wh.png\" alt=\"\" width=\"632\" height=\"475\" class=\"alignnone size-full wp-image-3985\" srcset=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_wh.png 632w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_wh-300x225.png 300w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a>\n<h3>relwidth\u3068relheight<\/h3>\n<p>relwidth\u3068relheight\u3067\u76f8\u5bfe\u8ddd\u96e2\u306b\u3088\u308b\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u5e45\u3001\u9ad8\u3055\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u76f8\u5bfe\u8ddd\u96e2\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u30b5\u30a4\u30ba\u30921\u3068\u3057\u30010\uff5e1\u306e\u7bc4\u56f2\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4e0a\u306e\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001\u753b\u9762\u5e45\u306e50%\u3001\u9ad8\u3055\u306e30%\u3092\u5360\u3081\u308b\u3088\u3046\u914d\u7f6e\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nlabel.place(relx=0.5, rely=0.5, anchor=tk.CENTER, relwidth=0.5, relheight=0.3)\r\n<\/pre>\n<a href=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_relwh.png\"><img loading=\"lazy\" src=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_relwh.png\" alt=\"\" width=\"632\" height=\"475\" class=\"alignnone size-full wp-image-3986\" srcset=\"https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_relwh.png 632w, https:\/\/www.python.ambitious-engineer.com\/wp-content\/uploads\/2022\/08\/place_center_rel_relwh-300x225.png 300w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001place\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u914d\u7f6e\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002\u5c11\u3057\u8907\u96d1\u3067\u9577\u3044\u305f\u3081\u4e00\u65e6\u3055\u3089\u3063\u3068\u6d41\u3057\u8aad\u307f\u3001\u5b9f\u969b\u306bGUI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u969b\u306b\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8aad\u3080\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002 ...<\/p>\n","protected":false},"author":1,"featured_media":3866,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[217],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/3961"}],"collection":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/comments?post=3961"}],"version-history":[{"count":22,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/3961\/revisions"}],"predecessor-version":[{"id":4128,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/3961\/revisions\/4128"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media\/3866"}],"wp:attachment":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media?parent=3961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=3961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=3961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}