Re: [gtk-list] Re: rewrite question:how to attach a pixmap to aGtkWindowas the background



> Sorry I couldn't be of more help. Maybe someone else has seen this
> flicker effect before.
>
> -Matt

My guess is the widgets are setting the background attribute
as well.  When realized, they invoke gtk_style_set_background which in
turn invokes gdk_window_set_background and
gdk_window_set_back_pixmap.  But it's only a guess...

Is there a reason it can't be done with styles, rather than
going to the GDK level?
  How about

 GtkStyle *new_style;

new_style = gtk_style_copy( gtk_widget_get_style(window1) );
new_style->bg_pixmap[GTK_STATE_NORMAL] =
                     gdk_pixmap_create_from_xpm(window1->window,&mask,
                      &new_style->bg[GTK_STATE_NORMAL],"./BACKGROUND.XPM");
gtk_set_style( window1, new_style );

Or have I misunderstood? (Always possible!)
Donna

----- Original Message -----
From: Matt Long <matt.long@wcom.com>
To: <gtk-list@redhat.com>
Cc: <tdukes@ibmoto.com>
Sent: Wednesday, August 25, 1999 4:18 PM
Subject: [gtk-list] Re: rewrite question:how to attach a pixmap to
aGtkWindowas the background


> I don't know if this will help you much, but I took your source code and
> moved these lines:
>
>    file://create pixmap
>    style=gtk_widget_get_style(window1);
>
>
>
pixmap=gdk_pixmap_create_from_xpm(window1->window,&mask,&style->bg[GTK_STATE
_NORMAL],
> "./BACKGROUND.XPM");
>
>    gdk_window_set_back_pixmap(window1->window,pixmap,0);
>
> and placed them before the button creation. If you do this, recompil,
> and run, you will notice that the backgroud pixmap flashes (e.g. it
> appears for a split second) and then all you see is what you described
> previously. This is somewhat strange. I tried commenting out different
> parts of the code to determine which part(s) may be obfuscating the
> pixmap, but was unsuccessful.
>
> Sorry I couldn't be of more help. Maybe someone else has seen this
> flicker effect before.
>
> -Matt
>
> Jiang XU wrote:
> >
> > I have been driven crazy!!
> >
> > But, first thanks Todd!, at least I can get the GdkWindow.
> > But I still can not put the pixmap as the background of the GtkWIndow.
It
> > doesn't show up!!
> > So, I guess I still need Help!!
> > Thanks very much!!
> >




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