[gtkada] bitmaps problem

Emmanuel Briot briot at gnat.com
Wed Jan 3 12:18:18 CET 2001


 > I have little experience with glade and need to include an image (bmp or pcx) in
 > my application. In early applications I have created the images using pixmap,
 > but now the images I need are some complicated and large to be recreated with
 > pixmap. Is there any way to convert from bmp or pcx into a pixmap format? I am
 > using glade 0.5.9 and GtkaAda 1.2.10


I don't think there is any provision for that in Glade itself.

You will have to use a standard Pixmap widget in Glade, and instead of filling
it with an actual pixmap, leave it blank.
Then, in the generated Ada code, add calls to Gdk.Pixbuf to insert your jpg,
gif,... image. See the example in testgtk/ for more information on how to use
Gdk.Pixbuf.

Modifying the generated code shouldn't be a problem, since GtkAda is mostly
capable of merging your changes if you decide to regenerate the code at some
point.
The code that can't be merged gets warnings that you have to fix before being
able to compile, so there's no risk of you compiling incorrect sources.

regards,
Emmanuel




More information about the gtkada mailing list