Re: can anybody help with bebugging a little displaying program?



nw

the second argument is the drawable, ie pixmap. the third is the GC
which can be the window style your gonna put the pixmap in. 

So you might use:

gdk_pixbuf_render_to_drawable(pixbuf, pixmap,
  window->style->fg_gc[GTK_STATE_NORMAL],
  sx,sy,dx,dy,w,h,GDK_RGB_DITHER_NORMAL,0,0);

alternatively you can create a default gc style for the pixmap and use
that for the second argument.

Simon


On Tue, 2002-03-19 at 12:51, guo li wrote:

Hi, there,

do u mean I should use:

GtkPixmap *pixmap;

pixmap=gtk_pixmap_new();
gdk_pixbuf_render_to_drawable (pixbuf, ???,???, 0, 0,0,0, 

but how can I fill in the 2nd and 3rd arguments for
gdk_pixbuf_render_to_drawable ?

sorry, I am really new in GTK, thank you so much!

guo 

From: Simon Hookway 
To: guo li 
    * 
Subject: Re: can anybody help with bebugging a little displaying
program? 
Date: 19 Mar 2002 12:13:22 +1100 

Sure 

what you have: 

GtkWidget *window; 
GdkPixbuf *pixbuf; 
GtkWidget *widget; 

window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 
widget = gtk_event_box_new(); 
gdk_pixbuf_render_to_drawable (pixbuf, 
widget->window,widget->style->white_gc, 0, 0,0,0, 
gdk_pixbuf_get_width(pixbuf), 

widget->window is NOT a drawable, thus your mistake. Instead render it 
to a pixmap and pack the pixmap into the eventbox and then pack the 
eventbox into the window. 

Simon 






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