# Disabling Gtk::Button

**URL:** <https://www.ruby-forum.com/t/disabling-gtk-button/63149>\
**Category:** Ruby-Gnome 2\
**Created:** [June 12, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/disabling-gtk-button/63149 "2006-06-12T19:31:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ar1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@ar1](https://www.ruby-forum.com/u/ar1)\
**Post date:** [June 12, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/disabling-gtk-button/63149/1 "2006-06-12T19:31:04Z")

</div>

Hi,

I’m creating a game that has a few buttons, and once the player has won,  
the  
buttons should be disabled (i.e. they cannot be clicked anymore). The  
window  
should still be there though so the user can view the final game board.

I could not find a method in the Gtk::Button API for disabling a button.  
How  
to achieve this?

Thanks,

Aditya

---

<div class="post-metadata">

**Author:** ![ar1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@ar1](https://www.ruby-forum.com/u/ar1)\
**Post date:** [June 12, 2006, 8:07pm UTC](https://www.ruby-forum.com/t/disabling-gtk-button/63149/2 "2006-06-12T20:07:29Z")

</div>

On So, 2006-06-11 at 22:24 -0500, Aditya R. wrote:

> Hi,
> 
> I’m creating a game that has a few buttons, and once the player has  
> won, the buttons should be disabled (i.e. they cannot be clicked  
> anymore). The window should still be there though so the user can view  
> the final game board.
> 
> I could not find a method in the Gtk::Button API for disabling a  
> button. How to achieve this?

Hi,

use

my\_button.sesitive = false

you can also use it for containers to de/activete complete groups of  
widgets

cheers  
detlef
