[gtk-list] Re: Perl/Gtk Questions
- From: "Putzar, Robin" <rputzar SECTOR DE>
- To: "'gtk-list redhat com'" <gtk-list redhat com>
- Subject: [gtk-list] Re: Perl/Gtk Questions
- Date: Wed, 23 Sep 1998 19:02:27 +0200
> ----------
> Von: ggt@netspace.net.au[SMTP:ggt@netspace.net.au]
> Gesendet: Donnerstag, 17. September 1998 14:20
> An: gtk-list@redhat.com
> Betreff: [gtk-list] Perl/Gtk Questions
>
> 1) How do you set the background color of the Tooltips widget?
>
There was a posting on the gtk-app-devel-list. It was for C, but it may
help you:
> ----------
> Von: Ralf Doering[SMTP:Ralf.Doering@Prakinf.TU-Ilmenau.DE]
> Gesendet: Montag, 14. September 1998 16:16
> An: gtk-app-devel-list@redhat.com
>
> Hello
>
> > I'm writing a little project using GTK.
> > Now I want to use the Tooltips widget on a Button.
> > Everything works fine, except one:
> > I can't change the color of the tooltip.
> > I want to have a wonderfull yellow instead of
> > that ugly grey which is default.
> > I looked into the Tutorial, but there wasn't any help.
> > Then I looked into the GIMP source.
> > This really confused me so I decided to mail to this
> > List .
>
> I hacked the same thing some time ago ...
> Not sure if this is the best way to do it, but it works.
>
> --------------- CODE --------------------
>
> GtkTooltips* create_yellow_tooltips(){
> GdkColor *t_fore,*t_back;
> GtkTooltips * tip;
>
> t_fore=(GdkColor*)g_malloc( sizeof(GdkColor));
> t_back=(GdkColor*)g_malloc( sizeof(GdkColor));
> /* First create a default Tooltip */
> tip = gtk_tooltips_new();
>
> /* Try to get the colors */
> if ( gdk_color_parse("Yellow",t_back)){
> g_print("Parsed Yellow.\n");
> if(
> gdk_color_alloc(gdk_colormap_get_system(),t_back)){
> g_print("Yellow allocated.\n");
>
> gdk_color_black(gdk_colormap_get_system(),t_fore);
> gtk_tooltips_set_colors(tip,t_back,t_fore);
> }else
> g_print("Can not allocate Color
> \"Yellow\".\n");
>
> }else
> g_print("Cannot parse Color-Spec.\n");
> return tip;
>
> }
>
> ------------------ END_CODE ---------------------------
>
> Ralf
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]