[gtkada] adding addition things to pixmaps

Emmanuel Briot briot at gnat.com
Tue Sep 26 11:01:03 CEST 2000


 > > the image is a map and as the train goes around i want the text fields to 
 > > have the number of the train going through the section. I can write out what 
 > > trains are in what sections but i'm not sure how to add text fields ontop of 
 > > an image
 > 
 > If you use a label widget it should be transparent. Look at the new
 > canvas widget in GtkAda, maybe it can be used?


Probably you don't need the full power of the Gtkada_Canvas, since the latter
is mostly intended for cases where you want to be able to move your widgets
around, and link them to each other.
You might also have some chance with a Gtk_Fixed widget:
Here are a few ideas, I haven't tried any of them:

  Use a Gtk_Fixed widget.
  Set a back pixmap for it  (see Gdk.Window.Set_Back_Pixmap)

  Put your labels as standard widgets, at specific coordinates in the
  Gtk_Fixed widget (I guess that the sections of your train track don't move
  around, right ?)

Or you could do everything by hand, by using a Gtk_Drawing_Area, and drawing
your pixmap directly to it as well as the labels (Draw_Pixmap, Draw_Text, ...)

Save the pixmap in a hidden window, so that you can restore part of it
whenever a text changes and you need to draw a new value.

Emmanuel




More information about the gtkada mailing list