# Button

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/Button
- **Çeviri tarihi:** 2025-09-08

## Açıklama

> **KULLANIMDAN KALKTI:** Bunu kullanmamanızı tavsiye ederiz. Gelecekteki bir güncellemede değiştirilebilir veya kaldırılabilir.
> Sadece [Panel:SetActionFunction](https://wiki.facepunch.com/gmod/Panel:SetActionFunction) ile geriye dönük uyumluluk için mevcuttur. Bunun yerine [DButton](https://gmod.tr/wiki/DButton) kullanın.

[Kaynağı görüntüle](https://github.com/Facepunch/garrysmod/blob/dfdafba0f04e75be122961291a56d9c1714a3d8a/garrysmod/lua/vgui/dbutton.lua#L181-L193)

## Ebeveyn

Bu sayfada listelenmeyen metotları vb. [DButton](https://gmod.tr/wiki/DButton)'dan miras alır.

## Uygular

Aşağıdaki kancaları/metotları uygular veya geçersiz kılar. Eğer bunları geçersiz kılmak isterseniz, muhtemelen orijinal fonksiyonu da çağırmak istersiniz.

- [PANEL:Init](https://gmod.tr/wiki/PANEL:Init)
- [PANEL:Paint](https://gmod.tr/wiki/PANEL:Paint)
- [PANEL:PerformLayout](https://gmod.tr/wiki/PANEL:PerformLayout)
- [Panel:GenerateExample](https://gmod.tr/wiki/PANEL:GenerateExample)
- [Panel:SetActionFunction](https://wiki.facepunch.com/gmod/Panel:SetActionFunction)
- [DButton:DoClick](https://wiki.facepunch.com/gmod/DButton:DoClick)
- [DButton:DoRightClick](https://wiki.facepunch.com/gmod/DButton:DoRightClick)

### Örnek

Üzerinde `"Click Me"` yazan ve basıldığında konsola "Hello World!" yazdıran bir düğme oluşturur.

```lua
local frame = vgui.Create( "DFrame" )
frame:SetTitle( "Button example" )
frame:SetSize( 200, 100 )
frame:MakePopup()
frame:Center()

local button = vgui.Create( "Button" , frame )
button:Dock( FILL )
button:SetVisible( true )
button:SetText( "Click Me" )
function button:OnMousePressed()
	print( "Hello World!" )
end
```

**Çıktı:**

![Button_Example.png](https://gmod.tr/api/uploads/wiki/daaefdd1fa2231df2970.png)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/Button
