Re: GdkPixmap



I believe that the GdkWindow *window is there so that the pixmap
creation knows what colormap to allocate the colors from.  It
is not the actual location that the pixmap will end up being.

So, you would do.. 

   {
    GdkBitmap *mask;
    GdkPixmap *pixmap_data;
    GtkWidget *pixmap;
    pixmap_data = gdk_pixmap_create_from_xpm ((GdkWindow *)Mainwindow->window,
	                                 &mask, trans_color, filename);
    pixmap = gtk_pixmap_new (pixmap_data, mask);
   }
    and then if you already have an HBox created called 'hbox',
   
        gtk_box_pack_start_defaults (GTK_BOX (hbox), pixmap);
   
    or don't use the defaults, whichever you prefer.

-john
 
On Sun, Sep 02, 2001 at 04:52:29PM +0100, Nuno Afonso wrote:
> Hi,
> 
> > Hi Nuno, a menu item is just a container: you can put anything inside.
> >
> > - make an hbox
> >
> > - put your pixmap and your text into the hbox
> 
> here is where i have the problem:
> 
> >GdkPixmap*  gdk_pixmap_create_from_xpm      (GdkWindow *window,
> >                                             GdkBitmap **mask,
> >                                             GdkColor *transparent_color,
> >                                             const gchar *filename);
> 
> the first argument is a GdkWindow... but i should be passing a GtkHBox...
> Can anybody tell me how to put the pixmap in the GtkHBox?
> 
> Nuno Afonso
> 
> _______________________________________________
> 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]