# Tooltips disable doesn't

**URL:** <https://www.ruby-forum.com/t/tooltips-disable-doesnt/148913>\
**Category:** Ruby-Gnome 2\
**Created:** [September 18, 2008, 10:20am UTC](https://www.ruby-forum.com/t/tooltips-disable-doesnt/148913 "2008-09-18T10:20:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [September 18, 2008, 10:20am UTC](https://www.ruby-forum.com/t/tooltips-disable-doesnt/148913/1 "2008-09-18T10:20:11Z")

</div>

Howdy!

I was playing around with CheckMenuItem and thought a quick feature  
would be to toggle my tooltips. Well my understanding of the  
Gtk::Tooltips class is incomplete as I can’t get it to disable the  
tooltips. Here’s some code that demonstrates:

#!/usr/bin/env ruby

# The following code demonstrates that the Gtk::Tooltips.disable

# does not function as documented on the wiki. The tooltips are

# always available on the buttons even after executing

tooltips.disable

require ‘gtk2’

Gtk.init

window = Gtk::Window.new ‘testing tooltip enable/disable’  
window.signal\_connect(‘destroy’) { Gtk.main\_quit }  
window.signal\_connect(‘delete\_event’) { false }

hbox = Gtk::HBox.new  
enable\_button = Gtk::Button.new ‘Enable Tooltips’  
disable\_button = Gtk::Button.new ‘Disable Tooltips’

tooltips = Gtk::Tooltips.new  
tooltips.set\_tip enable\_button, ‘Press to enable tooltips’, ‘’  
tooltips.set\_tip disable\_button, ‘Press to disable tooltips’, ‘’

tooltips.disable

enable\_button.signal\_connect(‘clicked’) { puts ‘enable’ ;  
tooltips.enable }  
disable\_button.signal\_connect(‘clicked’) { puts ‘disable’ ;  
tooltips.disable }

hbox.add enable\_button  
hbox.add disable\_button  
window.add hbox

window.show\_all  
Gtk.main

Any ideas on the correct way to disable tooltips? Or is this a bug or a  
feature change?

Thank you,  
Roy

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [September 18, 2008, 12:53pm UTC](https://www.ruby-forum.com/t/tooltips-disable-doesnt/148913/2 "2008-09-18T12:53:20Z")

</div>

I don’t know why I doesn’t work (I think it should), but tooltips are  
deprecated since gtk 2.12

You are now supposed to use mybutton.tooltip\_text= (or tooltip\_markup,  
tooltip\_window, etc)
