Re: Setting an image as background in a GtkVbox



Hi

I got this same problem

I resolved by using
void MyBackWidget(GtkWidget *myVbox,char * szFile,int xPos,int yPos,int sizeH,int sizeV)
{
  GtkWidget * hCtrl;
  GtkFixed * box = myVbox//getFixedBox( (GObject*) HB_PARHANDLE(1) );
  GdkPixbuf * handle = gdk_pixbuf_new_from_file( szFile, NULL );
  if ( box )
     gtk_fixed_put( box, hCtrl, xPos, yPos );
  gtk_widget_set_size_request( hCtrl,sizeH,sizeV );
}

Regards
Luiz



----- Original Message ----- From: Nacho
To: gtk-list gnome org
Sent: Monday, May 05, 2008 6:36 AM
Subject: Setting an image as background in a GtkVbox


Hi,

 Anybody knows how to set an image as background in a GtkBox?

I tried it overriding the expose-event doing something like this:

static gboolean
on_expose_event_cb (GtranslatorWellcomePanel *panel,
           GdkEventExpose *event,
           gpointer        useless)
{
   GdkPixbuf *pixbuf;
   GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (panel));

   pixbuf = gdk_pixbuf_scale_simple (panel->priv->bg,
                     GTK_WIDGET (panel)->allocation.width,
                     gdk_pixbuf_get_height (panel->priv->bg),
                     GDK_INTERP_NEAREST);

   gdk_draw_pixbuf (event->window,
style->bg_gc[0], pixbuf, 0, 0, 0, 0, gdk_pixbuf_get_width (pixbuf),
            gdk_pixbuf_get_height (pixbuf), GDK_RGB_DITHER_NORMAL, 0, 0);


   return TRUE;
}

But the i have the problem that other widgets are not showed.

Regards.




_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list

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