Re: [gtkmm] Tooltips on Toolbuttons



On Sat, 2004-10-02 at 21:28, Chris Vine wrote:
> Can you try the unwrapped GTK+ objects and 
> see if you get the same result?
Yes, same behaviour.  Test case attached.

John
#include <gtk/gtk.h>

int main(int argc, char** argv)
{
	gtk_set_locale();
	gtk_init(&argc, &argv);

	GtkWindow *win;
	GtkToolbar *bar;
	GtkTooltips *tips;
	GtkToolButton *button;

	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	bar = gtk_toolbar_new();
	tips = gtk_tooltips_new();
	button = gtk_tool_button_new_from_stock(GTK_STOCK_OK);

	gtk_container_add(GTK_CONTAINER(win), GTK_WIDGET(bar));
	gtk_toolbar_set_tooltips(bar, TRUE);

	gtk_toolbar_append_widget(bar, GTK_WIDGET(button), NULL, NULL);

	// Doesn't work
	//gtk_tooltips_set_tip(tips, GTK_WIDGET(button), "tooltips_set_tip", "tooltips_set_tip");
	
	// Works
	gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(button), tips, "item_set_tooltip", "item_set_tooltip");

	gtk_widget_show_all(GTK_WIDGET(win));

	gtk_main();
	return 0;
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]