---
# System prepended metadata

title: place( ) 方法
tags: [活用tkinter – 學習運用GUI]

---

# place( ) 方法
###### tags: `活用tkinter – 學習運用GUI`





## 使用x / y 參數
```python=
label_1.place(x = 10, y = 200)
label_2.place(x = 70, y = 200)
label_3.place(x = 150, y = 200)
```
* 結果
![](https://i.imgur.com/wvXUXvx.png)

## 使用width / height 參數
```python=
label_1 = Label(root, text = "男人的嘴，騙人的鬼", image = Ball, justify = "left", compound = "right")
label_1.place(x = 20, y = 20, width = 200, height = 200)

label_2 = Label(root, text = "男人的嘴，騙人的鬼", image = Ball, justify = "left", compound = "right")
label_2.place(x = 150, y = 300, width = 300, height = 400)
```
* 結果
![](https://i.imgur.com/j0jqezx.png)

## 使用relx / rely 與 relwidth / relheight 參數
* 這邊就是相對父視窗，以相對位置做判斷
```python=
label_1.place(relx = 0.1, rely = 0.1, relwidth = 0.8, relheight = 0.8)
```
* 結果(因為圖太大的緣故......)
![](https://i.imgur.com/JdHwLJr.png)

* 可以嘗試把參數拿掉做實驗喔!! :+1: 




{%hackmd S1DMFioCO %}