[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: gtk+-1.2.5 breaks stuff? tooltips colors again...[SOLVED]
- From: Thomas Niederreiter <hor ork rz fh-muenchen de>
- To: gtk-app-devel-list redhat com
- Subject: Re: gtk+-1.2.5 breaks stuff? tooltips colors again...[SOLVED]
- Date: Wed, 6 Oct 1999 08:48:40 +0200
On Wed, Sep 29, 1999 at 09:04:13AM +0200, Thomas Niederreiter wrote:
> Hi,
>
> I just updated to GTK+1.2.5 and found that there are several new
> assertions that fail in my app (which worked flawlessly up to gtk-1.2.4).
> So..I guess I did some things different as the developers of gtk
> expected and it was pure luck that the code works until now...
> Nevertheless... I does not work any longer and I have no clue why.
>
> The most annoying part here is, that my code that sets the color
> of a tooltip (a FAQ which never made it into the FAQ..) now segfaults..
>
> Here is the code sniplet (worked up to 1.2.4 fine):
>
> #define TOOLTIPCOL "light yellow"
>
> void define_tooltip(GtkWidget *widget, gchar *ttext) {
> GtkTooltips *tip;
> GdkColor bg;
> GtkStyle *style;
>
> tip = gtk_tooltips_new();
> gtk_tooltips_set_tip(tip,widget,ttext,NULL);
/* here is the thing that makes it work again */
gtk_tooltips_force_window(tip);
>
> /* set tip color (yellow) */
> gdk_color_parse(TOOLTIPCOL,&bg);
> gdk_color_alloc(gtk_widget_get_colormap(tip->tip_window),&bg);
> style = gtk_style_copy(gtk_widget_get_style(tip->tip_window));
> style->bg[GTK_STATE_NORMAL] = bg;
> gtk_widget_set_style(tip->tip_window, style);
> }
>
Inserting this single line and tooltip colors work fine.
I really hope somebody of the faq-maintainers are putting this in
the FAQ, because it seems a lot of people want to know how to change
the tooltip colors.
Thanx to Antonio M. Corbi Bello for providing me with this hint.
Thomas
___ ___
/ | \ ___________ | REAL : Thomas Niederreiter: Munich, Germany
/ ~ \/ _ \_ __ \ | EMAIL : tn@mailserv.rz.fh-muenchen.de
\ Y ( <_> ) | \/ | IRC : _Hor
\___|_ / \____/|__| |
\/ All I want is a warm bed and a kind word and unlimited power
-- Ashleigh Brilliant
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]