[9632] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re- Re: pixmaps

daemon@ATHENA.MIT.EDU (laur Ivan)
Thu Oct 29 09:49:25 1998

Date: Thu, 29 Oct 1998 14:32:37 +0000 (GMT)
From: laur Ivan <laur.ivan@ul.ie>
To: gtk-app-devel-list@redhat.com, gtk-list@redhat.com
In-Reply-To: <36379DEF.126579F0@ii.uib.no>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

	hi again.

	your code works perfectly for the drawing area, For the menu stuff
i've done the following alterations:
----------------
  glade1_pixmap = gdk_pixmap_create_from_xpm (window1->window,
&glade1_mask,

&window1->style->bg[GTK_STATE_NORMAL],

"/Compiler/gtktest/mini-cross.xpm");
  pixmap1 = gtk_pixmap_new (glade1_pixmap, glade1_mask);
  gdk_pixmap_unref (glade1_pixmap);
  gdk_bitmap_unref (glade1_mask);

  style = gtk_style_new ();

  style->bg_pixmap[GTK_STATE_NORMAL] =  glade1_pixmap;

  gtk_widget_set_style (menubar1,style);
-------------------

	The only problem (major one) i have is that the texts are with
gray background. if i try to put transparent pixmaps, i'm getting the same
gray background :(

	any ideas ?

On Wed, 28 Oct 1998, Tom Bech wrote:

> laur Ivan wrote:
> > 
> >         Hi,
> > 
> >         I've just started working with gtk/gnome, and I was wandering if
> > it is possible to have pixmaps as menu/scrollbar backgrounds without using
> > gtk themes and other simmilar stuff, i.e. if it can be done within the C
> > program. Can anyone tell me how to do it?
> > 
> 
> Indeed. This should do the trick:
> 
>   ..
>   grid_pixmap = gdk_pixmap_new (wid->window, gridsize, gridsize, -1);
> 
>   gdk_draw_rectangle (grid_pixmap, wid->style->bg_gc[0], TRUE, 0, 0, gridsize, gridsize);
>   gdk_draw_point (grid_pixmap, wid->style->black_gc, 0, 0);
> 
>   style = gtk_style_new ();
>   
>   style->bg_pixmap[GTK_STATE_NORMAL] =  grid_pixmap;
> 
>   gtk_style_detach (wid->style);
>   gtk_style_attach (style, wid->window);
> 
>   gtk_style_set_background (style, wid->window, GTK_STATE_NORMAL);
>   ..
> 
> This little snippet creates a "grid" pixmap and sets it to be a widget's
> background (in STATE_NORMAL mode, the widget is a drawing area in my case).
> 
> Hope this helps,
> 
> Tom
> 
> 
> -- 
>          To unsubscribe: mail gtk-app-devel-list-request@redhat.com with 
>                        "unsubscribe" as the Subject.
> 
> 	Mailing list concerns should be mailed to <listmaster@redhat.com>
> 
> 

+-------------------------------------+------------------------------------+
| Laur IVAN                           | Address (back home):               |
| University of Limerick              | St:Tr. Magurele 3, Bl:C2, Apt:137, |
| Schuman Bldg., Room SG-29           | Sect: 4, Bucharest, ROMANIA        |
| Limerick, IRELAND                   | Tel/Fax: +40-1-330.1177            | 
|         E-mail: laur.ivan@ul.ie or laur.ivan@scare.csis.ul.ie            |
|         HTTP:   http://scare.csis.ul.ie/~ilaur                           |
+-----------------------------------------------------------------Flop fX--+

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post