Re: How to create GdkPixmaps before windows

On Fri, 13 Apr 2001, Germano Rizzo wrote:

> Thank you very much for your answer. Unfortunately, I've some troubles in
> use of gdk_pixmap_new_from_xpm_d, as I have the xpm data stored in files.
>     I don't have clear if the gchar** argument refers to the xpm file
> content (with all the parenthesis, the header etc), as the API reference
> seems to indicate... but it don't seem to work; and I don't think it's so,
> reading the GTK tutorial... and, on the other hand, if so, why requesting a
> gchar** and not a gchar*?
>     If it's needed a 'structured' xpm array, I'm in trouble because I should
> somehow get it from the file I have... is there a commodity function to do
> this, or should I do it by hand?
>     I think I'll check the gnome-libs sources, to have an answer. For now,
> thank you very much and happy easter...

Try the following code snipet:
  /* this xpm file defines somepicture_xpm */
  #include <somepicture.xpm>

  GdkPixmap *pixmap;
  GdkBitmap *mask;

  /* widget is the widget you want to use the pixmap with, or at least one
   * that will share the same colormap */
  pixmap = gdk_pixmap_colormap_create_from_xpm_d(NULL,
       gtk_widget_get_colormap(widget), &mask, NULL, somepicture_xpm);


Email: james daa com au

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