$content->show();
$text->set_tooltip_window($tipswindow);
$text->connect('query-tooltip', 'redboxtip');
// trigger tooltip query for the display on button press
$vbox->add($button = new GtkButton('Trigger Tooltip passing Display'));
$button->connect_simple('clicked', array('GtkTooltip', 'trigger_tooltip_query'), GdkDisplay::get_default());
$button->set_has_tooltip(true);
$button->connect('query-tooltip', 'texttip');
// trigger tooltip query for a display where the widget is on button press
$vbox->add($button = new GtkButton('Trigger Tooltip passing Widget'));
$button->connect_simple('clicked', array($label, 'trigger_tooltip_query'));
$button->set_has_tooltip(true);
$button->connect('query-tooltip', 'texttip');
/* Generic liststore for the next tests */
$store = new GtkListStore(Gobject::TYPE_STRING, Gobject::TYPE_STRING, GdkPixbuf::gtype);
$store->append(array('foo', 'tip1', $window->render_icon(Gtk::STOCK_OPEN, Gtk::ICON_SIZE_DIALOG)));
$store->append(array('bar', 'tip2', $window->render_icon(Gtk::STOCK_CLOSE, Gtk::ICON_SIZE_DIALOG)));
$store->append(array('baz', 'tip3', $window->render_icon(Gtk::STOCK_SAVE, Gtk::ICON_SIZE_DIALOG)));
$store->append(array('kitty', 'tip4', $window->render_icon(Gtk::STOCK_OK, Gtk::ICON_SIZE_DIALOG)));
// callback that tells us if we have an item at the spot
function checkcontext($widget, $x, $y, $keyboard_mode, $tooltip)
{
    $list = $widget->get_tooltip_context($x, $y, $keyboard_mode);
    if (!$list) {
        return false;
    }
    list($model, $path, $iter) = $list;
    $tooltip->set_text($model->get_value($iter, 1));
    $widget->set_tooltip_item($tooltip, $path);
    // use set_tooltip_row for textview
    $widget->set_tooltip_cell($tooltip, $path, null);