GtkArrow should be used to draw simple arrows that need to point in one of the four cardinal directions (up, down, left, or right).
The style of the arrow can be one of shadow in, shadow out, etched in, or etched out. Note that these directions and style types may be amended in versions of GTK+ to come.
GtkArrow will fill any space alloted to it, but since it is inherited from Misc, it can be padded and/or aligned, to fill exactly the space the programmer desires.
Arrows are created with a call to Arrow. The direction or style of an arrow can be changed after creation by using @set.
GtkArrow has been deprecated; you can simply use a Image with a suitable icon name, such as “pan-down-symbolic“. When replacing GtkArrow by an image, pay attention to the fact that GtkArrow is doing automatic flipping between LEFT and RIGHT, depending on the text direction. To get the same effect with an image, use the icon names “pan-start-symbolic“ and “pan-end-symbolic“, which react to the text direction.
Example: Arrow:
public class Application : Gtk.Window {
public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.Arrow";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);
this.set_default_size (350, 70);
// The button:
Gtk.Arrow arrow = new Gtk.Arrow (Gtk.ArrowType.LEFT, Gtk.ShadowType.ETCHED_IN);
this.add (arrow);
}
public static int main (string[] args) {
Gtk.init (ref args);
Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}
valac --pkg gtk+-3.0 Gtk.Arrow.vala