how do i set the tooltip color?
- From: David Benson <daveb idealab com>
- To: gtk-list redhat com
- Subject: how do i set the tooltip color?
- Date: Thu, 17 Feb 2000 18:17:01 -0800 (PST)
I cannot seem to set the tooltip color, and I don't know why...
Here is my test program, which doesn't print any errors,
but also has a tooltip w/ default colors...
===== CUT
#include <gtk/gtkbutton.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtktooltips.h>
int main(int argc, char** argv)
{
GtkWidget* widget;
GtkWidget* window;
GtkTooltips* tooltips;
gboolean succeeded;
GdkColor colors[2];
gtk_init(&argc, &argv);
colors[0].red = 65535; /* red and green */
colors[0].green = 0;
colors[0].blue = 0;
colors[1].red = 0;
colors[1].green = 65535;
colors[1].blue = 0;
gdk_colormap_alloc_colors(gdk_colormap_get_system(),
colors,
2,
FALSE,
TRUE,
&succeeded);
g_return_val_if_fail(succeeded, 1);
widget = gtk_button_new_with_label("hello");
tooltips = gtk_tooltips_new();
gtk_tooltips_set_colors(tooltips, colors + 0, colors + 1);
gtk_tooltips_set_tip(tooltips, widget, "what?", "huh?");
gtk_widget_show(widget);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(window), widget);
gtk_widget_show(window);
gtk_main();
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]